mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix assignments preceding 'command <special builtin>' (#19)
Ksh was not checking for `command` when running a special builtin, which caused preceding invocation-local variable assignments to become global. This is the reproducer from the att/ast#72: $ foo=BUG command eval ':' $ echo "$foo" This no longer prints 'BUG', as ksh now makes sure the command builtin is not running a special builtin before making invocation-local variable assignments global. src/cmd/ksh93/sh/xec.c: - Backport the bugfix for BUG_CMDSPASGN from ksh93v- 2013-10-10-alpha. src/cmd/ksh93/tests/builtins.sh: - Add a regression test based on the reproducer in att/ast#72.
This commit is contained in:
parent
c258a04f7a
commit
fae8862c53
4 changed files with 10 additions and 8 deletions
|
@ -697,5 +697,10 @@ whence -q export) || err_exit '`builtin -d` deletes special builtins'
|
|||
printf '\\\000' | read -r -d ''
|
||||
[[ $REPLY == $'\\' ]] || err_exit "read -r -d '' ignores -r"
|
||||
|
||||
# ======
|
||||
# Preceding a special builtin with `command` should disable its special properties
|
||||
foo=BUG command eval ':'
|
||||
[[ $foo == BUG ]] && err_exit '`command` fails to disable the special properties of special builtins'
|
||||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue