This update fixes exiting from an interactive bc session with ^D on
FreeBSD and Linux when using editline.
This bug was caused by the macOS fix for editline in version 7.0.0,
which has been reverted in this version.
This is a production release to fix three bugs, none of which
affects well formed scripts on FreeBSD:
The first bug is that bc/dc will exit on macOS when the terminal
is resized.
The second bug is that an array, which should only be a function
parameter, was accepted as part of larger expressions.
The third bug is that the value stack for dc was cleared on any error.
However, this is not how other dc behave. To bring dc more in line
with other implementations, this behavior was changed. This change is
why this version is a new major version.
This update fixes a bug that line breaks in printed numbers may not
match the line length set by the user. The value is printed correctly,
just not split as specified in some situations.
This is a production release that fixes an infinite loop bug in root()
and cbrt(), fixes a bug with BC_LINE_LENGTH=0, and adds the fib()
function to the extended math library to calculate Fibonacci numbers.
This version contains a fix for an issue that can affect complex
bc scripts that use multiple read() functions that receive input from
an interactive user. The same value could be returned multiple times.
This update fixes a few issues and adds new features:
- There was a discrepancy from the bc standard with regards to the
behavior of the "quit" command. This bc used to quit whenever it
encountered "quit" during parsing, even if it was parsing a full
file. Now, bc only quits when encountering "quit" after it has
executed all executable statements up to that point.
This behavior is slightly different from GNU bc, but users will
only notice the difference if they put "quit" on the same line
as other statements.
- A memory bug was caused by assigning a string to a non-local
variable in a function, then redefining the function with use of
the same non-local variable, which would still refer to a string
in the previous version of the function.
- Another memory bug was caused by passing an array argument to the
asciify() built-in function. In certain cases, that was wrongly
allowed, and the interpreter just assumed everything was correct
and accessed memory. Now that arrays are allowed as arguments (see
below), this is not an issue.
- A missing local in the uint*() family of functions in the extended
math library.
- A failure to clear the tail call list in dc on error.
- A crash when attempting to swap characters in command-line history
when no characters exist.
- SIGWINCH was activated even when history was not.
- If an array element was used as a parameter, and then a later
parameter had the same name as the array whose element was used,
bc would grab the element from the new array parameter, not the
actual element from before the function call.
- A new built-in function is_number() ("u" in dc) returns 1 if the
runtime argument is a number and 0 otherwise.
- A new is_string() built-in function ("t" in dc) returns 1 if the
runtime argument is a string and 0 otherwise.
- The new asciify() built-in function in bc converts a full array
of numbers into a string. This means that character-by-character
printing will not be necessary, and more strings than just
single-character ones will be able to be created.
- Stack traces are now given for runtime errors. In debug mode, the
C source file and line of errors are given as well.
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.
Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.
There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.
This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.
There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.
The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.
Approved by: portmgr (tcberner)
This update restores suppression of the prompt with option -P, which
had been missing if linked with libedit or libreadline.
Since building the version tagged as 5.3.3 leaves temporary files in
/tmp, this commit includes a post-release update that fixes this build
issue.
This update Restores support for suppression of the prompt with -P
when using the libedit or libreadline libraries for command line
editing and history.
This version supports multiple command line editing and history
implementations:
- editline (default)
- readline
- private implementation (as in prior versions)
The private implementation has been modified to treat ^D on an empty
input line as an EOF signal.
This version fixes two parse bugs when in POSIX standard mode. One of
these bugs was due to a quirk of the POSIX grammar, and the other was
because bc was too strict.
This version adds options and functions that allow to print numbers
in the open interval (-1 .. 1) with or without a leading 0 digit.
Additionally, an option has been added to prevent line wrap and
allows to print arbitrarily long results on a single line.
This is a new major release with a number of changes and extensions:
- Limited the number of temporary numbers and made the space for them
static so that allocating more space for them cannot fail.
- Allowed integers with non-zero scale to be used with power, places,
and shift operators.
- Added greatest common divisor and least common multiple to lib2.bc.
- Made bc and dc UTF-8 capable.
- Added the ability for users to have bc and dc quit on SIGINT.
- Added the ability for users to disable prompt and TTY mode by
environment variables.
- Added the ability for users to redefine keywords.
- Added dc's modular exponentiation and divmod to bc.
- Added the ability to assign strings to variables and array elements
and pass them to functions in bc.
- Added dc's asciify command and stream printing to bc.
- Added bitwise and, or, xor, left shift, right shift, reverse,
left rotate, right rotate, and mod functions to lib2.bc.
- Added the functions s2u(x) and s2un(x,n), to lib2.bc.
This update fixes the initialization of "scale" to 20 if started with
-l and the initial statement leads to an error (e.g. contains a syntax
error). Scale was initialized to 0 in that case.
Another change is the support of job control in interactive mode with
line editing enabled. The control characters have been interpreted as
editing commands only, prior to this version.
This version fixes an issue in dc: the P command did not pop the value
being printed from the stack.
The major version bump is due to the addition of Windows compatibility
and does not correspond to a change of functionality on POSIX systems.
This version fixes a potential division be 0 in the extended math library
(in the non-standard function "root") and makes length(0) return 1 to
restore the behavior of the traditional bc in FreeBSD and of GNU bc.
There is one functional change with regard to -e of -f in BC_ENV_ARGS resp.
DC_ENV_ARGS: these do no longer make the program exit after processing the
commands passed that way (which prevented to use the environment variables
to set parameters for interactive sessions, unless -f- was passed as the
last argument on the command line).
This version improves the compatibility with the bc and dc in base under
two aspects:
1) Remove printing of the version and copyright message for interactive
invocations of bc an dc.
2) Make dc exit after execution of commands passed via -e or -f. To get
the behavior of version 3.1.3 back, "-f -" can be appended to the
command line to read from STDIN until EOF.
Approved by: antoine (implicit)
This version fixes an incompatibility with GNU bc:
The statement:
if (a > b) 1
was rejected, unless followed by "else 0".
Approved by: antoine (implicit)