summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-08-03 22:17:29 +0000
committerjilles <jilles@FreeBSD.org>2010-08-03 22:17:29 +0000
commit184699830c5d6a596fdd993ea7f0c1a75283aae1 (patch)
treeeef8a00dc349a605166c3a9e8d248bb1c4c1cb2a /tools
parent25440e11e9a883c573d37a45aa87b288eb8d7368 (diff)
downloadFreeBSD-src-184699830c5d6a596fdd993ea7f0c1a75283aae1.zip
FreeBSD-src-184699830c5d6a596fdd993ea7f0c1a75283aae1.tar.gz
sh: Return 0 from eval if no command was given.
This makes a difference if there is a command substitution. To make this work, evalstring() has been changed to set exitstatus to 0 if no command was executed (the string contained only whitespace). Example: eval $(false); echo $? should print 0.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/builtins/eval5.04
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/eval5.0 b/tools/regression/bin/sh/builtins/eval5.0
new file mode 100644
index 0000000..3e86de9
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/eval5.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+# eval should return 0 if no command was executed.
+eval $(false)
OpenPOWER on IntegriCloud