mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Compare commits
18 Commits
v2.15.0.4
...
prod-2.15.
Author | SHA1 | Date | |
---|---|---|---|
|
a547c36f0a | ||
|
1e2698b42d | ||
|
33815f49e6 | ||
|
732279bcc3 | ||
|
7f4e1eb68d | ||
|
1232b59949 | ||
|
90feefc622 | ||
|
c97ee188ad | ||
|
ae85846839 | ||
|
e096bd9ad8 | ||
|
884b1bc81b | ||
|
a30a518ba7 | ||
|
bb3b861090 | ||
|
0a3469125e | ||
|
9b37e79f21 | ||
|
18cd1f9067 | ||
|
43fc022dc8 | ||
|
29695028cd |
31
CHANGES
31
CHANGES
@@ -1,3 +1,34 @@
|
||||
The following are the changes from calc version 2.15.0.6 to 2.15.0.7:
|
||||
|
||||
Thanks to GitHub user @bambooleafz a critical bug (GitHub issue
|
||||
#148 - https://github.com/lcn2/calc/issues/148) they identified
|
||||
was fixed.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.5 to 2.15.0.6:
|
||||
|
||||
Thanks to GitHub user @ashamedbit, a long standing memory leak in
|
||||
zrandom.c has been fixed.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.4 to 2.15.0.5:
|
||||
|
||||
make clobber now removes the legacy files: have_fpos.h, help/man,
|
||||
and help/usage. The latter 2 are now managed as help aliases
|
||||
in help.c.
|
||||
|
||||
make install now removes the legacy files: ${HELPDIR}/man
|
||||
and ${HELPDIR}/usage.
|
||||
|
||||
Fixed a problem where, when calc was linked with and uses GNU
|
||||
readline then for any multi-line copy-and-paste, only the first
|
||||
line is executed. Thanks to GitHub user @malfisya for reporting
|
||||
this problem, and thanks to GitHub user @gromit1811 for doing
|
||||
the research needed to overcome deficiencies in the GNU readline
|
||||
documentation, and for supplying the work-a-round to allow
|
||||
multi-line copy-and-paste to work as expected!
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.3 to 2.15.0.4:
|
||||
|
||||
Fixed bug that caused calc to fail to compile filepos2z() in file.c
|
||||
|
2
Makefile
2
Makefile
@@ -3478,7 +3478,7 @@ clobber: clean
|
||||
${RM} -rf .DS_Store; \
|
||||
fi
|
||||
${RM} -f func.show func.sort
|
||||
${RM} -f outfile
|
||||
${RM} -f outfile have_fpos.h
|
||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||
|
||||
# install everything
|
||||
|
@@ -1243,7 +1243,7 @@ EXT=
|
||||
|
||||
# The calc version in the form of x.y.z.w
|
||||
#
|
||||
VERSION= 2.15.0.4
|
||||
VERSION= 2.15.0.7
|
||||
|
||||
# The calc major version in the form of x.y.z
|
||||
#
|
||||
|
2
calc.man
2
calc.man
@@ -1512,7 +1512,7 @@ the following GitHub repo:
|
||||
https://github.com/lcn2/calc
|
||||
.in -0.5i
|
||||
.sp
|
||||
The very latest calc souece is found at the top master branch.
|
||||
The very latest calc source is found at the top master branch.
|
||||
|
||||
.PP
|
||||
|
||||
|
@@ -675,7 +675,7 @@ clean:
|
||||
${RM} -f COPYING COPYING-LGPL questions
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${BLT_HELP_FILES} full .all calc
|
||||
${RM} -f ${BLT_HELP_FILES} full .all calc man usage
|
||||
${RM} -f ${SINGULAR_FILES} ${DETAIL_CLONE}
|
||||
-${Q} if [ -e .DS_Store ]; then \
|
||||
echo ${RM} -rf .DS_Store; \
|
||||
@@ -743,6 +743,14 @@ install: all
|
||||
${RM} -f ${T}${HELPDIR}/md5; \
|
||||
echo "removed old ${T}${HELPDIR}/md5"; \
|
||||
fi;
|
||||
-${Q} if [ -f "${T}${HELPDIR}/man" ]; then \
|
||||
${RM} -f ${T}${HELPDIR}/man; \
|
||||
echo "removed old ${T}${HELPDIR}/man"; \
|
||||
fi;
|
||||
-${Q} if [ -f "${T}${HELPDIR}/usage" ]; then \
|
||||
${RM} -f ${T}${HELPDIR}/usage; \
|
||||
echo "removed old ${T}${HELPDIR}/usage"; \
|
||||
fi;
|
||||
|
||||
# Try to remove everything that was installed
|
||||
#
|
||||
|
@@ -13,7 +13,7 @@ following topics:
|
||||
config configuration parameters
|
||||
custom information about the custom builtin interface
|
||||
define how to define functions
|
||||
environment how environment variables effect calc
|
||||
environment how environment variables affect calc
|
||||
errorcodes calc generated error codes
|
||||
expression expression sequences
|
||||
file using files
|
||||
|
76
hist.c
76
hist.c
@@ -73,6 +73,8 @@
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
#define MIN(a,b) (((a) <= (b)) ? (a) : (b))
|
||||
|
||||
#if !defined(USE_READLINE)
|
||||
|
||||
E_FUNC FILE *curstream(void);
|
||||
@@ -1472,37 +1474,69 @@ quit_calc(int UNUSED(ch))
|
||||
* The readline/history libs do most of the dirty work for us, so we can
|
||||
* replace hist_init() and hist_term() with dummies when using readline.
|
||||
* For hist_getline() we have to add a newline that readline removed but
|
||||
* calc expects. For hist_saveline(), we have to undo this. hist_getline()
|
||||
* calc expects. For hist_saveline(), we have to undo this. hist_getline()
|
||||
* also has to cope with the different memory management schemes of calc and
|
||||
* readline.
|
||||
* readline (pointer to target buffer passed to hist_getline() vs. returned
|
||||
* malloc()ed buffer from readline()). While doing that, we also split
|
||||
* multi-line strings potentially returned by readline() in case of
|
||||
* bracketed paste mode even though its documentation promises to only return
|
||||
* single lines. For details, see https://github.com/lcn2/calc/issues/138
|
||||
* and https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
|
||||
*/
|
||||
|
||||
|
||||
size_t
|
||||
hist_getline(char *prompt, char *buf, size_t len)
|
||||
{
|
||||
char *line;
|
||||
STATIC char *rlbuf, *rlcur;
|
||||
|
||||
buf[0] = '\0';
|
||||
line = readline(prompt);
|
||||
if (!line) {
|
||||
switch (conf->ctrl_d) {
|
||||
case CTRL_D_NEVER_EOF:
|
||||
return 0;
|
||||
case CTRL_D_VIRGIN_EOF:
|
||||
case CTRL_D_EMPTY_EOF:
|
||||
default:
|
||||
quit_calc(0);
|
||||
not_reached();
|
||||
if (!rlbuf) {
|
||||
rlbuf = rlcur = readline(prompt);
|
||||
if (!rlbuf) {
|
||||
buf[0] = '\0';
|
||||
switch (conf->ctrl_d) {
|
||||
case CTRL_D_NEVER_EOF:
|
||||
return 0;
|
||||
case CTRL_D_VIRGIN_EOF:
|
||||
case CTRL_D_EMPTY_EOF:
|
||||
default:
|
||||
quit_calc(0);
|
||||
not_reached();
|
||||
}
|
||||
}
|
||||
}
|
||||
strlcpy(buf, line, len);
|
||||
buf[len - 2] = '\0';
|
||||
len = strlen(buf);
|
||||
buf[len] = '\n';
|
||||
buf[len + 1] = '\0';
|
||||
free(line);
|
||||
return len + 1;
|
||||
|
||||
/* eol: pointer to trailing newline (if there is one) or \0 */
|
||||
char *eol = strchr(rlcur, '\n');
|
||||
if (!eol) {
|
||||
eol = rlcur + strlen(rlcur);
|
||||
}
|
||||
/* len: length of line in target buffer including (possibly added)
|
||||
* newline, truncated if buffer is too small. Note that we reduce
|
||||
* the available buffer size by 1 so that we can safely add the
|
||||
* newline below.
|
||||
*/
|
||||
len = MIN(len - 1, (size_t)(eol - rlcur + 1));
|
||||
strlcpy(buf, rlcur, len);
|
||||
/* make sure we have a newline and NUL */
|
||||
buf[len - 1] = '\n';
|
||||
buf[len] = '\0';
|
||||
|
||||
/* skip over newline in readline buffer */
|
||||
if (*eol) {
|
||||
eol++;
|
||||
}
|
||||
/* prepare for next invocation: point to next line or free readline
|
||||
* buffer if we've reached EOL
|
||||
*/
|
||||
if (*eol) {
|
||||
rlcur = eol;
|
||||
} else {
|
||||
free(rlbuf);
|
||||
rlbuf = rlcur = NULL;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
2
qfunc.c
2
qfunc.c
@@ -1953,7 +1953,7 @@ qispowerof2(NUMBER *q, NUMBER **qlog2)
|
||||
* Set *qlog2 to base 2 logarithm of q, which will be a negative value,
|
||||
* and return true.
|
||||
*/
|
||||
*qlog2 = utoq(log2);
|
||||
**qlog2 = *utoq(log2);
|
||||
(*qlog2)->num.sign = !(*qlog2)->num.sign; /* set *qlog2 to -log2 */
|
||||
return true;
|
||||
}
|
||||
|
30
update_ver
30
update_ver
@@ -169,6 +169,7 @@ for i in $MK_SET1; do
|
||||
echo "$i: $VER_STRING"
|
||||
fi
|
||||
done
|
||||
echo
|
||||
if [[ -n $VER_ERR ]]; then
|
||||
echo "$0: FATAL: error in finding calc major version string"
|
||||
echo "$0: FATAL: exit 10"
|
||||
@@ -177,15 +178,36 @@ fi
|
||||
|
||||
# print other useful calc strings
|
||||
#
|
||||
export VER_CALC_OUTPUT=$(./ver_calc)
|
||||
echo 'Begin text strings used to produce this release:'
|
||||
echo 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
|
||||
echo
|
||||
echo "calc $(./ver_calc) release"
|
||||
echo
|
||||
echo 'calc-*'$(./ver_calc)'*'
|
||||
echo
|
||||
echo "Release v$(./ver_calc)"
|
||||
echo "$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "v$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "Release v$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "calc $VER_CALC_OUTPUT release"
|
||||
echo
|
||||
echo 'For use with sourceforge.net:'
|
||||
echo
|
||||
echo 'cd /home/pfs/project/calc/calc'
|
||||
echo "mkdir $VER_CALC_OUTPUT"
|
||||
echo "cd $VER_CALC_OUTPUT"
|
||||
echo 'mput calc-*'"$VER_CALC_OUTPUT"'*'
|
||||
echo 'put /home/chongo/tmp/README.txt'
|
||||
echo 'ls'
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
|
||||
echo 'End text strings used to produce this release:'
|
||||
echo
|
||||
|
||||
# All Done!!! -- Jessica Noll, Age 2
|
||||
#
|
||||
echo
|
||||
echo "VERSION in Makefile.config is up to date"
|
||||
exit 0
|
||||
|
@@ -64,7 +64,7 @@
|
||||
#define MAJOR_VER 2 /* level 1: major library version */
|
||||
#define MINOR_VER 15 /* level 2: minor library version */
|
||||
#define MAJOR_PATCH 0 /* level 3: major software version level */
|
||||
#define MINOR_PATCH 4 /* level 4: minor software version level */
|
||||
#define MINOR_PATCH 7 /* level 4: minor software version level */
|
||||
|
||||
|
||||
#endif /* !INCLUDE_VERSION_H*/
|
||||
|
Reference in New Issue
Block a user