diff options
author | Peter Stephenson <pws@zsh.org> | 2016-01-21 16:30:21 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2016-01-21 16:30:21 +0000 |
commit | 1aec003155e8ccd8e0e3b9a6bd8c9fdb141d5c81 (patch) | |
tree | be6e56b6ed2da83c5efdbf5df7165aca4bbc7be5 /Src | |
parent | 1c41f98aabc20fce8a1eb8fd7d1b6baabfa1dea5 (diff) | |
download | zsh-1aec003155e8ccd8e0e3b9a6bd8c9fdb141d5c81.tar.gz zsh-1aec003155e8ccd8e0e3b9a6bd8c9fdb141d5c81.tar.xz zsh-1aec003155e8ccd8e0e3b9a6bd8c9fdb141d5c81.zip |
37722: test builtin should return status 2 on syntax error
Diffstat (limited to 'Src')
-rw-r--r-- | Src/builtin.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index dd20f9eab..98ecb09e8 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -6531,7 +6531,7 @@ bin_test(char *name, char **argv, UNUSED(Options ops), int func) for (s = argv; *s; s++); if (s == argv || strcmp(s[-1], "]")) { zwarnnam(name, "']' expected"); - return 1; + return 2; } s[-1] = NULL; } @@ -6574,19 +6574,19 @@ bin_test(char *name, char **argv, UNUSED(Options ops), int func) if (errflag) { errflag &= ~ERRFLAG_ERROR; zcontext_restore(); - return 1; + return 2; } if (!prog || tok == LEXERR) { zwarnnam(name, tokstr ? "parse error" : "argument expected"); zcontext_restore(); - return 1; + return 2; } zcontext_restore(); if (*curtestarg) { zwarnnam(name, "too many arguments"); - return 1; + return 2; } /* syntax is OK, so evaluate */ |