aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2011-10-28 23:02:21 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2011-10-28 23:02:21 +0000
commit06842f4c3ed1c8d89af9f2e0cc122eefaa8274b5 (patch)
tree898f2b4e47e138b3a8c0a4b0fa253d24176ed897
parent1933a67cf4124b9d08487c5d6032060222b9e5e2 (diff)
downloadsrc-06842f4c3ed1c8d89af9f2e0cc122eefaa8274b5.tar.gz
src-06842f4c3ed1c8d89af9f2e0cc122eefaa8274b5.zip
sh: Add test for exit status of for loop without items.
POSIX says the exit status of a for loop without any items shall be 0. There are no exceptions if the exit status of the previous command was not 0 or if the item list contains a command substitution with non-zero exit status.
Notes
Notes: svn path=/head/; revision=226892
-rw-r--r--tools/regression/bin/sh/builtins/for1.04
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/for1.0 b/tools/regression/bin/sh/builtins/for1.0
new file mode 100644
index 000000000000..cd55e2ca029e
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/for1.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+false
+for i in `false`; do exit 3; done