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.
This commit is contained in:
parent
e432298ade
commit
f1058ba09a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268436
@ -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
|
||||
|
||||
|
4
bin/sh/tests/parameters/positional3.0
Normal file
4
bin/sh/tests/parameters/positional3.0
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
r=$(${SH} -c 'echo ${01:+yes}${010:+yes}' '' a '' '' '' '' '' '' '' '' b)
|
||||
[ "$r" = yesyes ]
|
Loading…
Reference in New Issue
Block a user