mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
POSIX compliance fix: apply 'set -u' to $!
POSIX requires[*] that expanding any unset parameter other than $@ and $* is an error when 'set -u'/'set -o nounset' is active. However, on ksh93, $! was exempt as well. That is a bug. [*] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25 src/cmd/ksh93/sh/macro.c: - special(): Handle 'set -u' for special parameters if/when it is about to return NIL. That code path is currently only possible to reach for "$!", but this is future-proof and will do the right thing if any other special parameter can ever have no value. src/cmd/ksh93/tests/options.sh: - Add and tweak 'set -u' regression tests. (cherry picked from commit 75cc7a38cafe3a9929e1ed17d8b952babda22a09)
This commit is contained in:
parent
36da314c9e
commit
5f8b0512f0
3 changed files with 26 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -10,6 +10,9 @@ Any uppercase BUG_* names are modernish shell bug IDs.
|
|||
nonexistent positional parameter such as $1, $2, ... is accessed, as other
|
||||
shells do and POSIX requires. (This does *not* apply to "$@" and "$*".)
|
||||
|
||||
- If 'set -u'/'set -o nounset' is active, then the shell now errors out if $!
|
||||
is accessed before the shell has launched any background process.
|
||||
|
||||
2020-06-06:
|
||||
|
||||
- The 'times' command is now a builtin command that conforms to POSIX
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue