1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-18 15:21:16 +02:00

25671: non existing variable in typeset -p should cause status 1

This commit is contained in:
Peter Stephenson 2008-09-15 08:57:25 +00:00
parent 06cc84ce84
commit 6951a1e0b2
3 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2008-09-15 Peter Stephenson <pws@csr.com>
* 25671: Src/builtin.c, Test/B02typeset.ztst: non-existent
variable in typeset -p should cause status 1.
2008-09-14 Clint Adams <clint@zsh.org> 2008-09-14 Clint Adams <clint@zsh.org>
* 25667: Src/Zle/complete.c: free mstr before returning from * 25667: Src/Zle/complete.c: free mstr before returning from

View file

@ -2479,8 +2479,10 @@ bin_typeset(char *name, char **argv, Options ops, int func)
if (OPT_ISSET(ops,'p')) { if (OPT_ISSET(ops,'p')) {
if (hn) if (hn)
printparamnode(hn, printflags); printparamnode(hn, printflags);
else else {
zwarnnam(name, "no such variable: %s", asg->name); zwarnnam(name, "no such variable: %s", asg->name);
returnval = 1;
}
continue; continue;
} }
if (!typeset_single(name, asg->name, (Param)hn, if (!typeset_single(name, asg->name, (Param)hn,

View file

@ -449,7 +449,7 @@
array=(foo bar) array=(foo bar)
fn() { typeset -p array nonexistent; } fn() { typeset -p array nonexistent; }
fn fn
0:declare -p shouldn't create scoped values 1:declare -p shouldn't create scoped values
>typeset -a array >typeset -a array
>array=(foo bar) >array=(foo bar)
?fn:typeset: no such variable: nonexistent ?fn:typeset: no such variable: nonexistent