Skip to content

Commit

Permalink
fix SHOPT_SCRIPTONLY regress fail (re: a7ab245)
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Aug 23, 2024
1 parent a7ab245 commit a412b4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/ksh93/tests/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ done
(( (SECONDS-t1) > .5 )) && err_exit 'pipefail should not wait for background processes'

# ======
if ((!SHOPT_SCRIPTONLY)); then
print $'v=$(. ./dotfile)\n(. ./dotfile)\ncat <(. ./dotfile)\n. ./dotfile' > envfile
# dot scripts sourced from profile files are parsed line by line, so that aliases take effect on the next line in the same file
print $'alias print=:\nprint fail:subshell==${.sh.subshell} >&2' > dotfile
Expand All @@ -545,7 +546,7 @@ got=$(ENV=/.$PWD/envfile "$SHELL" -i -c : 2>&1)
exp=$SHELL$'\n'$SHELL$'\n'$SHELL$'\n'$SHELL
[[ $got == "$exp" ]] || err_exit '$0 in ksh function in profile script not correct' \
"(expected $(printf %q "$exp"), got $(printf %q "$got"))"

fi # !SHOPT_SCRIPTONLY

# ======
if [[ -o ?posix ]]; then
Expand Down

0 comments on commit a412b4c

Please sign in to comment.