mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-18 09:41:09 +02:00
51306: error message in ${unset?error} should be expanded
This commit is contained in:
parent
21baad1037
commit
76d095df9d
4 changed files with 16 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
2023-02-02 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 51306: Doc/Zsh/expn.yo, Src/subst.c, Test/D04parameter.ztst:
|
||||
error message in ${unset?...} should be expanded.
|
||||
|
||||
* 51307: Src/input.c, Src/parse.c, Test/A02alias.ztst: error
|
||||
on attempt to expand alias in function definition name didn't
|
||||
find the original alias and printed an extra error.
|
||||
|
|
|
@ -665,7 +665,9 @@ item(tt(${)var(name)tt(:?)var(word)tt(}))(
|
|||
In the first form, if var(name) is set, or in the second form if var(name)
|
||||
is both set and non-null, then substitute its value; otherwise, print
|
||||
var(word) and exit from the shell. Interactive shells instead return to
|
||||
the prompt. If var(word) is omitted, then a standard message is printed.
|
||||
the prompt. If var(word) is omitted, then a standard message is
|
||||
printed. Note that var(word) is expanded even though its value
|
||||
is not substituted onto the command line.
|
||||
)
|
||||
enditem()
|
||||
|
||||
|
|
|
@ -3076,7 +3076,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
|
|||
if (vunset) {
|
||||
if (isset(EXECOPT)) {
|
||||
*idend = '\0';
|
||||
zerr("%s: %s", idbeg, *s ? s : "parameter not set");
|
||||
if (*s){
|
||||
singsub(&s);
|
||||
zerr("%s: %s", idbeg, s);
|
||||
} else
|
||||
zerr("%s: %s", idbeg, "parameter not set");
|
||||
/*
|
||||
* In interactive shell we need to return to
|
||||
* top-level prompt --- don't clear this error
|
||||
|
|
|
@ -110,6 +110,11 @@
|
|||
*>*foo:1: 1: no arguments given
|
||||
>reached
|
||||
|
||||
message="expand me and remove quotes"
|
||||
(: ${UNSET_PARAM?$message})
|
||||
1:${...?....} performs expansion on the message
|
||||
?(eval):2: UNSET_PARAM: expand me and remove quotes
|
||||
|
||||
print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}
|
||||
print ${unset1:+word5} ${unset1+word6}
|
||||
0:${...:+...}, ${...+...}
|
||||
|
|
Loading…
Reference in a new issue