summaryrefslogtreecommitdiffstats
path: root/bin/sh/tests
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-12-24 22:38:24 +0000
committerjilles <jilles@FreeBSD.org>2013-12-24 22:38:24 +0000
commitffaab89202d5b3809787a452e704ac0bb5550905 (patch)
treed2ad7db6c6630c2851cb3da8afe5aefdc6369f93 /bin/sh/tests
parent1889cef2a5639c665b57a56fd7532f99cda81ace (diff)
downloadFreeBSD-src-ffaab89202d5b3809787a452e704ac0bb5550905.zip
FreeBSD-src-ffaab89202d5b3809787a452e704ac0bb5550905.tar.gz
sh: Initialize OPTIND=1 even if it came from the environment.
Diffstat (limited to 'bin/sh/tests')
-rw-r--r--bin/sh/tests/parameters/Makefile1
-rw-r--r--bin/sh/tests/parameters/optind2.03
2 files changed, 4 insertions, 0 deletions
diff --git a/bin/sh/tests/parameters/Makefile b/bin/sh/tests/parameters/Makefile
index cb76474..fafc059 100644
--- a/bin/sh/tests/parameters/Makefile
+++ b/bin/sh/tests/parameters/Makefile
@@ -10,6 +10,7 @@ FILES+= exitstatus1.0
FILES+= mail1.0
FILES+= mail2.0
FILES+= optind1.0
+FILES+= optind2.0
FILES+= positional1.0
FILES+= positional2.0
FILES+= pwd1.0
diff --git a/bin/sh/tests/parameters/optind2.0 b/bin/sh/tests/parameters/optind2.0
new file mode 100644
index 0000000..a7689f6
--- /dev/null
+++ b/bin/sh/tests/parameters/optind2.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+[ "$(OPTIND=42 ${SH} -c 'printf %s "$OPTIND"')" = 1 ]
OpenPOWER on IntegriCloud