mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-24 23:14:14 +00:00
This fixes the following: 1. 'set --posix' now works as an equivalent of 'set -o posix'. 2. The posix option turns off braceexpand and turns on letoctal. Any attempt to override that in a single command such as 'set -o posix +o letoctal' was quietly ignored. This now works as long as the overriding option follows the posix option in the command. 3. The --default option to 'set' now stops the 'posix' option, if set or unset in the same 'set' command, from changing other options. This allows the command output by 'set +o' to correctly restore the current options. src/cmd/ksh93/data/builtins.c: - To make 'set --posix' work, we must explicitly list it in sh_set[] as a supported option so that AST optget(3) recognises it and won't override it with its own default --posix option, which converts the optget(3) string to at POSIX getopt(3) string. This means it will appear as a separate entry in --man output, whether we want it to or not. So we might as well use it as an example to document how --optionname == -o optionname, replacing the original documentation that was part of the '-o' description. src/cmd/ksh93/sh/args.c: sh_argopts(): - Add handling for explitit --posix option in data/builtins.c. - Move SH_POSIX syncing SH_BRACEEXPAND and SH_LETOCTAL from sh_applyopts() into the option parsing loop here. This fixes the bug that letoctal was ignored in 'set -o posix +o letoctal'. - Remember if --default was used in a flag, and do not sync options with SH_POSIX if the flag is set. This makes 'set +o' work. src/cmd/ksh93/include/argnod.h, src/cmd/ksh93/data/msg.c, src/cmd/ksh93/sh/args.c: sh_printopts(): - Do not potentially translate the 'on' and 'off' labels in 'set -o' output. No other shell does, and some scripts parse these. src/cmd/ksh93/sh/init.c: sh_init(): - Turn on SH_LETOCTAL early along with SH_POSIX if the shell was invoked as sh; this makes 'sh -o' and 'sh +o' show expected options (not that anyone does this, but correctness is good). src/cmd/ksh93/include/defs.h, src/cmd/ksh93/include/shell.h: - The state flags were in defs.h and most (but not all) of the shell options were in shell.h. Gather all the shell state and option flag definitions into one place in shell.h for clarity. - Remove unused SH_NOPROFILE and SH_XARGS option flags. src/cmd/ksh93/tests/options.sh: - Add tests for these bugs. src/lib/libast/misc/optget.c: styles[]: - Edit default optget(3) option self-documentation for clarity. Several changed files: - Some SHOPT_PFSH fixes to avoid compiling dead code. |
||
---|---|---|
.. | ||
alias.sh | ||
append.sh | ||
arith.sh | ||
arrays.sh | ||
arrays2.sh | ||
attributes.sh | ||
basic.sh | ||
bracket.sh | ||
builtins.sh | ||
case.sh | ||
comvar.sh | ||
comvario.sh | ||
coprocess.sh | ||
cubetype.sh | ||
enum.sh | ||
exit.sh | ||
expand.sh | ||
functions.sh | ||
glob.sh | ||
grep.sh | ||
heredoc.sh | ||
io.sh | ||
jobs.sh | ||
leaks.sh | ||
locale.sh | ||
math.sh | ||
nameref.sh | ||
namespace.sh | ||
options.sh | ||
path.sh | ||
pointtype.sh | ||
pty.sh | ||
quoting.sh | ||
quoting2.sh | ||
readcsv.sh | ||
recttype.sh | ||
restricted.sh | ||
return.sh | ||
select.sh | ||
shtests | ||
sigchld.sh | ||
signal.sh | ||
statics.sh | ||
subshell.sh | ||
substring.sh | ||
tilde.sh | ||
timetype.sh | ||
treemove.sh | ||
types.sh | ||
variables.sh | ||
vartree1.sh | ||
vartree2.sh |