Compare commits

...

4 Commits

Author SHA1 Message Date
Landon Curt Noll
9b69648921 Fix long lines in lib_calc.c 2018-11-28 12:33:10 -08:00
Landon Curt Noll
c5e416c41f Release calc 2.12.7.2
Fixed a segfault when getpwuid() returned NULL during initialization.
Thanks goes to baratharon GitHub user for reporting this issue.
2018-11-28 12:27:04 -08:00
Landon Curt Noll
37ad43c7fd Release calc 2.12.7.1
Corrected CHANGES notes that were mixed up for TAB, VT, CR &
NL.  The code in 2.12.7.0 is correct.  The CHANGE notes should
have read:

The following is a partial list of escape sequences recognized
in strings and in printf formats:

    \a	audible bell	byte 0x07 in ASCII encoding
    \b	backspace	byte 0x08 in ASCII encoding
    \f	form feed	byte 0x0c in ASCII encoding
    \n	newline		byte 0x0a in ASCII encoding
    \r	return		byte 0x0d in ASCII encoding
    \t	tab		byte 0x09 in ASCII encoding
    \v	vertical tab	byte 0x0b in ASCII encoding

Sorry!
2018-11-05 08:02:09 -08:00
Landon Curt Noll
a877cb52c0 Corrected CHANGES notes
Corrected CHANGES notes that were mixed up for TAB, VT, CR & NL.
The core in 2.12.7.0 is correct.  The CHANGE notes were mixed up.
Sorry!
2018-11-05 07:33:40 -08:00
6 changed files with 54 additions and 19 deletions

31
CHANGES
View File

@@ -1,4 +1,25 @@
The following are the changes from calc version 2.12.7.0 to date:
The following are the changes from calc version 2.12.7.1 to date:
Corrected CHANGES notes that were mixed up for TAB, VT, CR &
NL. The code in 2.12.7.0 is correct. The CHANGE notes should
have read:
The following is a partial list of escape sequences recognized
in strings and in printf formats:
\a audible bell byte 0x07 in ASCII encoding
\b backspace byte 0x08 in ASCII encoding
\f form feed byte 0x0c in ASCII encoding
\n newline byte 0x0a in ASCII encoding
\r return byte 0x0d in ASCII encoding
\t tab byte 0x09 in ASCII encoding
\v vertical tab byte 0x0b in ASCII encoding
Fixed a segfault when getpwuid() returned NULL during initialization.
Thanks goes to baratharon GitHub user for reporting this issue.
The following are the changes from calc version 2.12.6.10: to 2.12.7.0:
Added a patch to replaces the manual search for include files
in $(INCDIR) in the have_*.h targets with compiler invocations.
@@ -32,10 +53,10 @@ The following are the changes from calc version 2.12.7.0 to date:
\a audible bell byte 0x07 in ASCII encoding
\b backspace byte 0x08 in ASCII encoding
\f form feed byte 0x0c in ASCII encoding
\n newline byte 0x0b in ASCII encoding
\r return byte 0x0a in ASCII encoding
\t tab byte 0x0d in ASCII encoding
\v vertical tab byte 0x09 in ASCII encoding
\n newline byte 0x0a in ASCII encoding
\r return byte 0x0d in ASCII encoding
\t tab byte 0x09 in ASCII encoding
\v vertical tab byte 0x0b in ASCII encoding
The following are the changes from calc version 2.12.6.9 to 2.12.6.9:

View File

@@ -1054,7 +1054,7 @@ EXT=
# The default calc versions
#
VERSION= 2.12.7.0
VERSION= 2.12.7.2
# Names of shared libraries with versions
#

View File

@@ -348,7 +348,7 @@ EXT=
# The default calc versions
#
VERSION= 2.12.7.0
VERSION= 2.12.7.2
# Names of shared libraries with versions
#

View File

@@ -348,7 +348,7 @@ EXT=
# The default calc versions
#
VERSION= 2.12.7.0
VERSION= 2.12.7.2
# Names of shared libraries with versions
#

View File

@@ -1,7 +1,7 @@
/*
* lib_calc - calc link library initialization and shutdown routines
*
* Copyright (C) 1999-2007 Landon Curt Noll
* Copyright (C) 1999-2007,2018 Landon Curt Noll
*
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
@@ -504,22 +504,36 @@ initenv(void)
home = (c ? strdup(c) : NULL);
#if defined(_WIN32)
if (home == NULL || home[0] == '\0') {
/* free home if it was previously allocated, but empty */
if (home != NULL) {
free(home);
}
/* just assume . is home if all else fails */
home = ".";
home = strdup(".");
}
#else /* Windoz free systems */
if (home == NULL || home[0] == '\0') {
size_t pw_dir_len;
ent = (struct passwd *)getpwuid(geteuid());
if (ent == NULL) {
/* just assume . is home if all else fails */
home = ".";
/* free home if it was previously allocated, but empty */
if (home != NULL) {
free(home);
}
/* try using the home directory of current effective UID */
ent = (struct passwd *)getpwuid(geteuid());
if (ent == NULL || ent->pw_dir == NULL ||
ent->pw_dir[0] == '\0') {
/* just assume . is home if all else fails */
home = strdup(".");
} else {
/* use home directory of current effective UID */
home = strdup(ent->pw_dir);
}
pw_dir_len = strlen(ent->pw_dir);
home = (char *)malloc(pw_dir_len+1);
strncpy(home, ent->pw_dir, pw_dir_len+1);
}
#endif /* Windoz free systems */
/* paranoia */
if (home == NULL) {
math_error("Unable to allocate string for $HOME");
/*NOTREACHED*/
}
/* determine the $PAGER value */
c = (no_env ? NULL : getenv(PAGER));

View File

@@ -45,7 +45,7 @@ static char *program;
#define MAJOR_VER 2 /* major library version */
#define MINOR_VER 12 /* minor library version */
#define MAJOR_PATCH 7 /* major software level under library version */
#define MINOR_PATCH 0 /* minor software level or 0 if not patched */
#define MINOR_PATCH 2 /* minor software level or 0 if not patched */
/*