ash: parser: Only accept single-digit parameter expansion outside of braces
Upstream commit: Date: Mon, 27 May 2019 13:39:37 +0800 parser: Only accept single-digit parameter expansion outside of braces This patch should fix the problem. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3f4847b6d9
commit
c2ce888030
@ -12602,7 +12602,7 @@ parsesub: {
|
|||||||
do {
|
do {
|
||||||
STPUTC(c, out);
|
STPUTC(c, out);
|
||||||
c = pgetc_eatbnl();
|
c = pgetc_eatbnl();
|
||||||
} while (isdigit(c));
|
} while (!subtype && isdigit(c));
|
||||||
} else if (c != '}') {
|
} else if (c != '}') {
|
||||||
/* $[{[#]]<specialchar>[}] */
|
/* $[{[#]]<specialchar>[}] */
|
||||||
int cc = c;
|
int cc = c;
|
||||||
|
3
shell/ash_test/ash-vars/var_10.right
Normal file
3
shell/ash_test/ash-vars/var_10.right
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Zero:0
|
||||||
|
One:1
|
||||||
|
Done:0
|
4
shell/ash_test/ash-vars/var_10.tests
Executable file
4
shell/ash_test/ash-vars/var_10.tests
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
set -- : 2 3 4 5 6 7 8 9 ten eleven
|
||||||
|
echo Zero$10
|
||||||
|
echo One$11
|
||||||
|
echo Done:$?
|
3
shell/hush_test/hush-vars/var_10.right
Normal file
3
shell/hush_test/hush-vars/var_10.right
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Zero:0
|
||||||
|
One:1
|
||||||
|
Done:0
|
4
shell/hush_test/hush-vars/var_10.tests
Executable file
4
shell/hush_test/hush-vars/var_10.tests
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
set -- : 2 3 4 5 6 7 8 9 ten eleven
|
||||||
|
echo Zero$10
|
||||||
|
echo One$11
|
||||||
|
echo Done:$?
|
Loading…
Reference in New Issue
Block a user