mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
zsh-users/21903: Fix ${...?...} in interactive shell.
On failure should abort back to top level, but we reset the error flag around commands. Add a hard error flag that's only reset at top level.
This commit is contained in:
parent
be4c072cf5
commit
a4b8ee13be
4 changed files with 35 additions and 1 deletions
|
@ -95,6 +95,20 @@
|
|||
?(eval):1: unset1: exiting1
|
||||
?(eval):2: null1: exiting2
|
||||
|
||||
PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
|
||||
unsetopt PROMPT_SP
|
||||
PS2="" PS3="" PS4="" RPS1="" RPS2=""
|
||||
foo() {
|
||||
print ${1:?no arguments given}
|
||||
print not reached
|
||||
}
|
||||
foo
|
||||
print reached
|
||||
'
|
||||
0:interactive shell returns to top level on ${...?...} error
|
||||
?foo:1: 1: no arguments given
|
||||
>reached
|
||||
|
||||
print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}
|
||||
print ${unset1:+word5} ${unset1+word6}
|
||||
0:${...:+...}, ${...+...}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue