From 46141be5f917a47b99c4c3be62c9231ae9afca70 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 Oct 2004 10:39:41 +0000 Subject: 20412, tweaked: Make test builtin more POSIX compatible 20435: Make pattern.c not alter strings. --- Src/exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Src/exec.c') 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"); -- cgit v1.2.3