diff --git a/src/cmd/ksh93/sh/args.c b/src/cmd/ksh93/sh/args.c index b4fe735a8..db0556225 100644 --- a/src/cmd/ksh93/sh/args.c +++ b/src/cmd/ksh93/sh/args.c @@ -54,13 +54,12 @@ static char *null; /* The following order is determined by sh_optset */ -static const char optksh[] = PFSHOPT "\374" "DircabefhkmnpstuvxBCGEl" HFLAG; +static const char optksh[] = PFSHOPT "DircabefhkmnpstuvxBCGEl" HFLAG; static const int flagval[] = { #if SHOPT_PFSH SH_PFSH, #endif - SH_POSIX, SH_DICTIONARY, SH_INTERACTIVE, SH_RESTRICTED, SH_CFLAG, SH_ALLEXPORT, SH_NOTIFY, SH_ERREXIT, SH_NOGLOB, SH_TRACKALL, SH_KEYWORD, SH_MONITOR, SH_NOEXEC, SH_PRIVILEGED, SH_SFLAG, SH_TFLAG, diff --git a/src/cmd/ksh93/tests/options.sh b/src/cmd/ksh93/tests/options.sh index 666f327a2..b6344a8eb 100755 --- a/src/cmd/ksh93/tests/options.sh +++ b/src/cmd/ksh93/tests/options.sh @@ -531,4 +531,15 @@ print '. ./dotfile' > envfile print $'alias print=:\nprint foobar' > dotfile [[ $(ENV=/.$PWD/envfile $SHELL -i -c : 2>/dev/null) == foobar ]] && err_exit 'files source from profile does not process aliases correctly' +# ====== +# test that '-o posix' option (not having a letter) does not affect "$-" expansion +( + command set +o posix 2>/dev/null + opt1=$- + command set -o posix 2>/dev/null + opt2=$- + [[ $opt1 == "$opt2" ]] +) || err_exit '-o posix option affects $- expansion' + +# ====== exit $((Errors<125?Errors:125))