summaryrefslogtreecommitdiffstats
path: root/bin/sh/tests
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2014-07-12 10:27:30 +0000
committerjilles <jilles@FreeBSD.org>2014-07-12 10:27:30 +0000
commit16670f204520ea21385b04e0f28b3b8b810c1460 (patch)
tree9565d5942cb94174c2fcbea095eedbaca8a3c50f /bin/sh/tests
parenta07e081f5d6641e2af6e38f67eea2a09b09e51cf (diff)
downloadFreeBSD-src-16670f204520ea21385b04e0f28b3b8b810c1460.zip
FreeBSD-src-16670f204520ea21385b04e0f28b3b8b810c1460.tar.gz
sh: Consistently treat ${01} like $1.
Leading zeroes were ignored when checking whether a positional parameter is set, but not when expanding its value. Ignore leading zeroes in any case.
Diffstat (limited to 'bin/sh/tests')
-rw-r--r--bin/sh/tests/parameters/Makefile1
-rw-r--r--bin/sh/tests/parameters/positional4.04
2 files changed, 5 insertions, 0 deletions
diff --git a/bin/sh/tests/parameters/Makefile b/bin/sh/tests/parameters/Makefile
index 4f9ae31..2574226 100644
--- a/bin/sh/tests/parameters/Makefile
+++ b/bin/sh/tests/parameters/Makefile
@@ -14,6 +14,7 @@ FILES+= optind2.0
FILES+= positional1.0
FILES+= positional2.0
FILES+= positional3.0
+FILES+= positional4.0
FILES+= pwd1.0
FILES+= pwd2.0
diff --git a/bin/sh/tests/parameters/positional4.0 b/bin/sh/tests/parameters/positional4.0
new file mode 100644
index 0000000..c1c380c
--- /dev/null
+++ b/bin/sh/tests/parameters/positional4.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+set -- "x$0" 2 3 4 5 6 7 8 9 "y$0"
+[ "${01}.${010}" = "$1.${10}" ]
OpenPOWER on IntegriCloud