summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-03-07 23:52:23 +0000
committerjilles <jilles@FreeBSD.org>2011-03-07 23:52:23 +0000
commit28c75d673cd3bd32c3ec740c5e2a352d5c7ff8a5 (patch)
tree0c5fb639c2771324baa41da5a84f53cce91e581c /tools
parentc0ee0d94ddc48e7f23ba167ac55c7785a943f23c (diff)
downloadFreeBSD-src-28c75d673cd3bd32c3ec740c5e2a352d5c7ff8a5.zip
FreeBSD-src-28c75d673cd3bd32c3ec740c5e2a352d5c7ff8a5.tar.gz
sh: Test that . /dev/null returns exit status 0 and does not preserve $?.
Preserving $? may cause problems particularly if set -e is in effect. It may be useful to preserve the old value of $? in the dot script but this must not be implemented in such a way that it would break this test.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/builtins/dot3.010
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/dot3.0 b/tools/regression/bin/sh/builtins/dot3.0
new file mode 100644
index 0000000..b337f0f
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/dot3.0
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+# . should return 0 if no command was executed.
+
+if false; then
+ exit 3
+else
+ . /dev/null
+ exit $?
+fi
OpenPOWER on IntegriCloud