diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2014-07-08 22:04:44 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2014-07-08 22:04:44 +0000 |
commit | f1058ba09afa97cc45769b6e8e84d34910e510ec (patch) | |
tree | 8c8bd75929e6020dd037ad894eaa6a1d5e3d51ba /bin/sh/tests/parameters | |
parent | e432298ade8c0f7cc2bc0969c318086dc12ce86a (diff) | |
download | src-f1058ba09afa97cc45769b6e8e84d34910e510ec.tar.gz src-f1058ba09afa97cc45769b6e8e84d34910e510ec.zip |
sh: Add test for ${01} and ${010} that already works.
Although it is probably unwise to use this, POSIX is clear that leading
zeroes are permitted in positional parameters (and do not indicate octal).
Such positional parameters are checked for being unset and/or null
correctly, but their value is incorrectly expanded.
Notes
Notes:
svn path=/head/; revision=268436
Diffstat (limited to 'bin/sh/tests/parameters')
-rw-r--r-- | bin/sh/tests/parameters/Makefile | 1 | ||||
-rw-r--r-- | bin/sh/tests/parameters/positional3.0 | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/bin/sh/tests/parameters/Makefile b/bin/sh/tests/parameters/Makefile index fafc059ec24f..4f9ae31ce3b5 100644 --- a/bin/sh/tests/parameters/Makefile +++ b/bin/sh/tests/parameters/Makefile @@ -13,6 +13,7 @@ FILES+= optind1.0 FILES+= optind2.0 FILES+= positional1.0 FILES+= positional2.0 +FILES+= positional3.0 FILES+= pwd1.0 FILES+= pwd2.0 diff --git a/bin/sh/tests/parameters/positional3.0 b/bin/sh/tests/parameters/positional3.0 new file mode 100644 index 000000000000..1200469b4e12 --- /dev/null +++ b/bin/sh/tests/parameters/positional3.0 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +r=$(${SH} -c 'echo ${01:+yes}${010:+yes}' '' a '' '' '' '' '' '' '' '' b) +[ "$r" = yesyes ] |