Tags: YoruStar/ksh
Tags
Release 1.0.10
Here is the tenth ksh 93u+m/1.0 bugfix release -- exactly two years
after 93u+m/1.0.0 and twelve years after 93u+. Unfortunately, we're
not done fixing bugs yet, but progress continues steadily.
Main changes between ksh 93u+m/1.0.9 and 93u+m/1.0.10:
- Fixed a serious and longstanding bug in the arithmetic subsystem
that was triggered on non-Intel processors (such as ARM): any
division of an integer by a negative integer threw a spurious
"divide by zero" error.
- Fixed a regression where a broken pipe signal (SIGPIPE), when
occurring in a pipe construct within a subshell, caused incorrect
signal handling in the parent/main shell, in some cases causing a
script to abort.
- Fixed a bug where printf %T, after having printed the time in UTC
once with the TZ variable set to "UTC", would always print the
time in UTC from then on, even if the TZ variable was changed to
another time zone.
- The history expansion character ('!' by default) is now not
processed when immediately following '${'. This makes it psosible
to use expansion syntax like ${!varname} and ${!prefix@} on the
interactive command line with the histexpand option on; these no
longer trigger an "event not found" error.
- The shell is now capable of handling more than 32767 simultaneous
background jobs, subject to system limitations.
Release 1.0.9
Here is the ninth ksh 93u+m/1.0 bugfix release.
Main changes between ksh 93u+m/1.0.8 and 93u+m/1.0.9:
- Android/Termux is now a supported platform. Build dependencies:
binutils, clang, getconf. Runtime dependencies (optional):
ncurses-utils, getconf.
- Reintroduced support for building a dynamically linked
ksh(1)/shcomp(1), with libast, libdll, libcmd, and libshell
available to other programs as dynamic libraries. 'bin/package
install /your/basepath' will install development headers. The
dynamically linked version is built in a 'dyn' subdirectory;
there are no changes to the statically linked version. Dynamic
linking is currently tested and supported on Linux, Android,
macOS, all the BSDs, illumos, Solaris, QNX, and Haiku.
- On systems where the external printf(1) utility supports
deprecated pre-POSIX syntax for formatters starting with '-', ksh
now adapts its built-in printf to match, for compatibility with
system scripts. However, ksh's built-in printf options such as -v
or --man are not affected.
- Fixed a regression in the 'printf' built-in, introduced in
93u+m/1.0.5, where each instance of '\0' or '%Z' in the format
operand caused a string argument to be incorrectly skipped.
- Fixed a regression, introduced in 93u+m/1.0.5, in ordinal
specifiers in 'printf %T' date specifications. For example,
printf '%(%F)T\n' '4th tuesday in march 2016'
wrongly printed '2016-04-09' and now again correctly prints
'2016-03-22'.
- Fixed a regression of 'return' within traps, reintroduced in
93u+m/1.0.8 after being fixed in 93u+m/1.0.0. The regression
caused a 'return' or 'exit' with no arguments to assume the
before-trap exit status instead of that of the last-run command.
This broke the shipped 'autocd' function.
- Fixed a longstanding bug in shell arithmetic: the representation
of negative integers with a base other than 10 was incorrectly
treated as unsigned long. For example,
typeset -i16 n=-12; echo $n
now correctly outputs '-16#c' and no longer ouputs
'16#fffffffffffffff4'.
- Fixed a bug, introduced in ksh93q+ 2005-05-22, that stopped an
append assignment from working together with a declaration
command. For example, 'typeset var+=value' or 'export var+=value'
now again work as expected.
- Fixed a longstanding bug where the default terminal width for
typeset -L, -R, or -Z, if not given, was miscalculated for
multibyte or control characters.
- Fixed: expansions of name references in loops were incorrectly
treated as invariant so they yielded the wrong values.
- If a .get or .getn discipline function is set for a variable, it
is no longer incorrectly triggered when performing an arithmetic
assignment on that variable; only the .set discipline is now
triggered (as documented).
- Many other bug fixes (see the NEWS file).
Release 1.0.8 Happy new year! Here is the eighth ksh 93u+m/1.0 bugfix release. Main changes between ksh 93u+m/1.0.7 and 93u+m/1.0.8: - Fixed a regression in the behavior of 'exit' in a trap action. The exit status used when no argument is given to 'exit' is now once again the exit status of the last command executed *before* the trap action. - Fixed a race condition, introduced in 1.0.7, that occurred on some systems when running an external command with a standard output redirection from a command substitution. - Fixed an init-time crash on failure to trim the shell command history file due to a non-writable parent directory; ksh now prints a warning instead. - The 'kill' built-in command now correctly refuses to issue SIGSTOP to the shell's own process if the shell is a login shell.
Release 1.0.7
Here is the seventh ksh 93u+m/1.0 bugfix release. It fixes a hang
in command substitutions when combined with 'exec' and certain
redirections.
Main changes between ksh 93u+m/1.0.6 and 93u+m/1.0.7:
- Fixed a hang in command substitutions (introduced in 93u+m/1.0.0)
that was triggered when redirecting standard output within a
command substitution, in combination with other factors. E.g.,
the following no longer hangs:
{ v=$(redirect 2>&1 1>&9); } 9>&1
- Fixed a crash on trying to append an indexed array value to an
unset name reference, e.g.: nameref unsetref; unsetref+=(foo
bar). This now produces a "removing nameref attribute" warning
before performing the assignment.
- Fixed: assignments like name=(...) to arrays did not preserve the
array and variable types; similarly, assigning an empty set () to
a compound indexed array caused the -C attribute to be lost.
- Fixed incorrect rejection of the tab key while reading input
using the 'read' built-in command.
- Fixed a bug in printf %T: when using dates and times in the past,
time zones for the present were incorrectly used, ignoring
historical changes.
Release 1.0.6
Sooner than expected after the fifth, here is the sixth ksh
93u+m/1.0 bugfix release. 93u+m/1.0.5 brought a wide range of
bugfixes and robustness enhancements, but also introduced a serious
regression in pathname expansion, so that previous release is
WITHDRAWN and should not be used.
Main changes between ksh 93u+m/1.0.5 and 93u+m/1.0.6:
- Fixed a serious regression in pathname expansion where quoted
wildcard characters were incorrectly expanded if a pattern
contains both a brace expansion and a variable expansion.
- Fixed a bug where the command to launch a full-screen editor
(^X^E in emacs and 'v' in vi) could cause the wrong command line
to be edited if two shell sessions share a .sh_history file.
Main changes between ksh 93u+m/1.0.4 and 93u+m/1.0.5:
- Fixed various bugs causing crashes.
- Fixed many bugs in the emacs and vi line editors, in command
completion, and in file name completion.
- Fixed various bugs in the handling of quotes, backslash escapes
and braces when processing shell glob patterns (e.g. in pathname
expansion and 'case').
- ksh now throws a panic and exits if a read error (such as an I/O
error) occurs while trying to read the next command(s) from a
running script.
- Fixed many bugs in 'printf' and 'print -f' built-in commands,
including:
. Multiple bugs causing incorrect output for relative date
specifications, e.g., printf %T\\n 'exactly 20 months ago' now
outputs a correct result.
. More printf bugs with mix and match of % and %x$.
. A data corruption bug when using %B with 'printf -v varname'.
. A bug causing double evaluation of arithmetic expressions.
- Fixed a bug where 'unset -f commandname', executed in a subshell,
hides any built-in command by the same name for the duration of
that subshell.
- Fixed ${var/#/string} and ${var/%/string} (with anchored empty
pattern) to work as on mksh, bash and zsh; these are no longer
ineffective.
- Fixed incorrect result of array slicing ${array[@]:offset:length}
where 'length' is a nested expansion involving an array.
- Command names can now end in ':' as they can on other shells.
- Fixed a spurious syntax error in compound assignments upon
encountering a pair of repeated opening parentheses '(('.
- Fixed spurious syntax error in ${parameter:offset:length}: the
arithmetic expressions 'offset' and 'length' may now contain the
operators ( ) & |.
- Fixed a parsing bug in the declaration of .sh.math.* arithmetic
functions.
- Fixed nameref self-reference loop detection for more than two
namerefs.
- Several improvements to the POSIX compatibility mode.
- Many more minor and/or esoteric bugfixes.
Release 1.0.4
Main changes between 1.0.3 and 1.0.4:
- Fixed multiple scoping-related bugs in the += additive assignment
operator.
- A number of crashing bugs have been fixed.
- Various fixes for the Haiku operating system, notably 'ulimit -a'
now works.
- Fixed the expansion of out-of-range \n back references in the
string part of ${parameter//pattern/string}. For example:
v=AB; echo "${v/@(A)B/\0:\1:\2}"
now yields 'AB:A:' instead of 'AB:A:\2'.
- Fixed quoted '!', '^' and '-' within [bracket] expressions in
glob patterns; single or double quotes failed to disable their
operator behaviour.
- Fixed a bug introduced on 2021-04-04 that incorrectly allowed
'typeset' to turn off the readonly and export attributes on a
readonly variable.
- In the emacs line editor, the Ctrl+R reverse-search prompt is
now visually distinct from a literal control character ("^R: "
instead of "^R").
- In the vi line editor, fixed the behaviour of 'C', 'c$' and 'I'
to be consistent with standard vi(1) and with Bolsky & Korn
(1995, p. 121).
- Aliases for many GNU long options have been added to the
/opt/ast/bin built-in commands. Additionally, 'kill -s' now has
a --signal long option alias compatible with the util-linux
option.
- Backported support for 'print -u p' from ksh 93v- for
compatibility with scripts written for 93v-/ksh2020 (this is
equivalent to 'print -p').
Release 1.0.3
This point release mainly fixes the following:
- A bug in history expansion (set -H) where any use of the history
comment character caused processing to be aborted as if it were
an invalid history expansion. Affected e.g. 'echo ${#v}'.
- A bug in command line options processing that caused short-form
option equivalents on some built-in commands to be ignored after
one use, e.g., the new read -a equivalent of read -A.
- Ksh freezing or using excessive memory if HISTSIZE is assigned a
pathologically large value.
- A bug that caused ksh in the vi editor mode to crash or produce
invalid completions if ESC = was used at the beginning of a line.
Release 1.0.2 (re: cd06386) This release fixes the interactive shell crashing when one of the predefined aliases (currently 'history' and 'r') is redefined, whether from a profile/kshrc script or manually. This crash occurred in two scenarios: 1. when redefining and then unsetting a predefined alias; 2. when redefining a predefined alias and then executing a shell script that does not begin with a #! path. Both are fixed now.
Revert buggy exec optimisation (re: d6c9821) As of 2022-06-18, ksh 93u+m is not capable of being used as /bin/sh while building GNU binutils. The execution of some of its build system's dot scripts is incorrectly aborted as an external 'sed' command is execve(2)'d without forking. This means that incorrect exec optimization was happening. Unfortunately I have not been able to derive a minimal reproducer of the problem yet because the GNU binutils build scripts are very complex. Pending further research, the optimisation is reverted. Even if a way to make it work is found, it will not be reintroduced to the 1.0 branch. Thanks to @atheik for finding the problem and identifying the commit that introduced it. Resolves: ksh93#507
Release 93u+m/1.0.0 _ _ ___ _____ ___ ___ ___ | | _____| |__ / _ \___ / _ _ _ _ __ ___ / / | / _ \ / _ \ | |/ / __| '_ \ | (_) ||_ \| | | |_| |_| '_ ` _ \ / /| || | | | | | | | <\__ \ | | | \__, |__) | |_| |_ _| | | | | |/ / | || |_| | |_| | |_|\_\___/_| |_| /_/____/ \__,_| |_| |_| |_| |_/_/ |_(_)___(_)___/ It may have taken exactly a decade, but here we are... a proper new ksh release. :) Many thanks to all contributors for their hard work! Compared to an unpatched 93u+, this release has roughly a thousand bugs fixed. It incorporates a fair number of enhancements as well. Not all known bugs have been worked out yet; see the TODO file. Let's hope this release will rekindle interest and attract more bug hunters. This commit also makes some very minor fixes in comments. Notable: src/cmd/ksh93/sh/arith.c: sh_strnum(): - Update a security-related comment. As of b48e5b3, evaluating untrusted arithmetic expressions from the environment should no longer cause CVE-2019-14868. But let's keep disallowing it anyway. Resolves: ksh93#491
PreviousNext