The following are the changes in this release:
Starting with calc version 2.16.0.0, the ability to perform arithmetic
on addresses of values in calc objects has been greatly restricted.
Most arithmetic on of value addresses could easily cause calc to
crash. For example, prior to calc version 2.16.0.0, the following
command was likely to crash calc:
calc '*((&.)+1e9)'
Subtracting two value addresses is permitted, however there is NO
guarantee that the address of a value will remain consistent across
calc runs. Addresses of values depend on the circumstances of when
the calc values were formed.
The above restrictions and caveats apply to addresses of values.
Such restrictions and caveats to NOT apply to the addresses of
octets, NOR to the addresses within strings. If isptr(x) == 2, then
x is value-pointer and the above mentioned restrictions and caveats apply.
See "help address" for more information on value address arithmetic.
Added E_INVALID_DEREF (10610) error code to indicate the invalid
dereferencing a non-variable.
Added E_INVALID_ADDR_OP (10611) error code to indicate an invalid
arithmetic address operation.
We plan to let this most recent change settle down before performing
the calc v2 to calc v3 fork. Therefore, version 2.16.1.0 will form
the basis for the calc v2 to calc v3 fork.
Removed use of HAVE_MEMMOVE as well have_memmv.c. Removed the
building and including of have_memmv.h. Removed the memmove()
function in blkcpy.c, used when HAVE_MEMMOVE was NOT defined.
The libc memmove(3) function as defined by <string.h> is now
required to compile calc because the replacement code in
blkcpy.c q was problematic, especially when regions overlap.
The HAVE_MEMMOVE make symbol was removed from Makefile.config.
Thanks to GitHub user @skeeto for reporting this problem.
Change Makefile.config to, if not using not HomeBrew, then try to
detect macports and/or using /opt/local/{lib,include}.
Changed version from 2.15.1.0 to 2.15.1.1.
Put full date range (1989-2025) of calc source into version.h.
The following are the changes in this release:
Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The command `git diff -w` reports no changes. There is no
functionality change in calc: only ASCII tabs to ASCII spaces.
Fixed trailblank. It was pruning . in its find search.
Added check for ASCII tabs is non-Makefiles.
This version will form the basis for the calc v2 to calc v3 fork.
Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The `git diff -w` reports no changes.
The following are the changes in this release:
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!
make clobber also removes the legacy files: help/man, and help/usage.
make install now removes the legacy files: ${HELPDIR}/man and
${HELPDIR}/usage.
Document the GNU readline then for any multi-line copy-and-paste
fix in CHANGES.
Fix for #138
According to
https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
it's OK for readline() to return multi-line strings and/or newlines in case
of bracketed paste (enabled by default since readline 8.1) and also in other
situations even though its documentation explicitly states the opposite. So
we need to handle this properly in calc instead of just using the first line
and dropping the rest: Split the string returned by readline() into lines
and return line by line with each invocation of hist_getline(), each
possbily adding a terminating newline.
The following are the changes in this release:
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. Be sure to use ||'s between []'s
to avoid problems with legacy shell such as the Bourne shell. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
The top level Makefile needs to use multiple []'s between ||'s
to not cause problems for legacy shells such as the Bourne shell.
For example:
```make
-${Q} if [ -z "${MANDIR}" ] || [ ! -s calc.1 ]; then \
...
-${Q} if [ -z "${CATDIR}" ] || [ ! -s calc.cat1 ]; then \
```
The following are the changes in this release:
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.