diff --git a/NEWS b/NEWS index c0fa3248d..16b751465 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,12 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0 Any uppercase BUG_* names are modernish shell bug IDs. +2022-05-27: + +- Fixed a bug introduced on 2022-03-05 where 'set --default', while turning + off the --posix option, did not re-enable the special handling of a repeated + $IFS whitespace character as non-whitespace. + 2022-05-25: - Fixed a bug introduced on 2021-02-20 that caused incorrect output for diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index d4af15fd8..e2bd413c8 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -21,7 +21,7 @@ #define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */ #define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */ -#define SH_RELEASE_DATE "2022-05-25" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_DATE "2022-05-27" /* must be in this format for $((.sh.version)) */ #define SH_RELEASE_CPYR "(c) 2020-2022 Contributors to ksh " SH_RELEASE_FORK /* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */ diff --git a/src/cmd/ksh93/sh/args.c b/src/cmd/ksh93/sh/args.c index 5e8488553..36701ec96 100644 --- a/src/cmd/ksh93/sh/args.c +++ b/src/cmd/ksh93/sh/args.c @@ -170,8 +170,14 @@ int sh_argopts(int argc,register char *argv[]) { register const Shtable_t *tp; for(tp=shtab_options; o = tp->sh_number; tp++) + { if(!(o&SH_COMMANDLINE) && (o&=0xff)!=SH_RESTRICTED && is_option(&newflags,o)) + { off_option(&newflags,o); + if(o==SH_POSIX) + sh_invalidate_ifs(); + } + } } defaultflag++; continue; diff --git a/src/cmd/ksh93/tests/posix.sh b/src/cmd/ksh93/tests/posix.sh index 91702deeb..8f98907ea 100644 --- a/src/cmd/ksh93/tests/posix.sh +++ b/src/cmd/ksh93/tests/posix.sh @@ -113,6 +113,9 @@ got=$(set --noposix; set $val; echo "$#") exp=5 [[ $got == "$exp" ]] || err_exit "repeated IFS whitespace char (noposix): incorrect number of fields" \ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" +got=$(set --default; set $val; echo "$#") +[[ $got == "$exp" ]] || err_exit "repeated IFS whitespace char (default): incorrect number of fields" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" IFS=$' \t\n' # default # causes file descriptors > 2 to be left open when invoking another program;