Module Name:    src
Committed By:   kre
Date:           Wed May  3 05:49:54 UTC 2017

Modified Files:
        src/bin/sh: eval.c

Log Message:
So sayeth posix (of the special builtin "eval"):
        If there are no arguments, or only null arguments,
        eval shall return a zero exit status;

Make it so.   Now:
        false; eval; echo $?
produces 0 instead of 1.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/bin/sh/eval.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.132 src/bin/sh/eval.c:1.133
--- src/bin/sh/eval.c:1.132	Wed May  3 00:47:29 2017
+++ src/bin/sh/eval.c	Wed May  3 05:49:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.132 2017/05/03 00:47:29 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.133 2017/05/03 05:49:54 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.132 2017/05/03 00:47:29 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.133 2017/05/03 05:49:54 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -199,7 +199,8 @@ evalcmd(int argc, char **argv)
                         p = grabstackstr(concat);
                 }
                 evalstring(p, builtin_flags & EV_TESTED);
-        }
+        } else
+		exitstatus = 0;
         return exitstatus;
 }
 

Reply via email to