Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh So sayeth posix (of the special builtin "eval"):



details:   https://anonhg.NetBSD.org/src/rev/9a203cfe9d56
branches:  trunk
changeset: 823692:9a203cfe9d56
user:      kre <kre%NetBSD.org@localhost>
date:      Wed May 03 05:49:54 2017 +0000

description:
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.

diffstat:

 bin/sh/eval.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r e63eabe7c21d -r 9a203cfe9d56 bin/sh/eval.c
--- a/bin/sh/eval.c     Wed May 03 04:51:04 2017 +0000
+++ b/bin/sh/eval.c     Wed May 03 05:49:54 2017 +0000
@@ -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 @@
                         p = grabstackstr(concat);
                 }
                 evalstring(p, builtin_flags & EV_TESTED);
-        }
+        } else
+               exitstatus = 0;
         return exitstatus;
 }
 



Home | Main Index | Thread Index | Old Index