summaryrefslogtreecommitdiff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-10-05 10:39:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-10-05 10:39:41 +0000
commit46141be5f917a47b99c4c3be62c9231ae9afca70 (patch)
tree2fb5fc3aa156905062ff689272fc012ae3335db3 /Src/exec.c
parent684da738b06f27d2736d6f60429f26206dc2ffbc (diff)
downloadzsh-46141be5f917a47b99c4c3be62c9231ae9afca70.tar.gz
zsh-46141be5f917a47b99c4c3be62c9231ae9afca70.zip
20412, tweaked: Make test builtin more POSIX compatible
20435: Make pattern.c not alter strings.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index fb1433764..8c2124c43 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3187,7 +3187,13 @@ execcond(Estate state, UNUSED(int do_exec))
tracingcond++;
}
cmdpush(CS_COND);
- stat = !evalcond(state);
+ stat = evalcond(state, NULL);
+ /*
+ * 2 indicates a syntax error. For compatibility, turn this
+ * into a shell error.
+ */
+ if (stat == 2)
+ errflag = 1;
cmdpop();
if (isset(XTRACE)) {
fprintf(xtrerr, " ]]\n");