diff options
-rw-r--r-- | shell/ash.c | 3 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var_unbackslash1.right | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_unbackslash1.tests | 20 | ||||
-rw-r--r-- | shell/hush_test/hush-vars/var_unbackslash1.right | 4 | ||||
-rwxr-xr-x | shell/hush_test/hush-vars/var_unbackslash1.tests | 20 |
5 files changed, 50 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index b71fc02..97f8d93 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11437,7 +11437,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) if (parenlevel > 0) { parenlevel--; } else { - if (pgetc() == ')') { + if (pgetc_eatbnl() == ')') { c = CTLENDARI; if (--arinest == 0) { syntax = prevsyntax; @@ -11464,6 +11464,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) if (varnest == 0) { #if ENABLE_ASH_BASH_COMPAT if (c == '&') { +//Can't call pgetc_eatbnl() here, this requires three-deep pungetc() if (pgetc() == '>') c = 0x100 + '>'; /* flag &> */ pungetc(); diff --git a/shell/ash_test/ash-vars/var_unbackslash1.right b/shell/ash_test/ash-vars/var_unbackslash1.right index 8d4eca3..3e0c0e2 100644 --- a/shell/ash_test/ash-vars/var_unbackslash1.right +++ b/shell/ash_test/ash-vars/var_unbackslash1.right @@ -1,3 +1,7 @@ Ok Ba d Ok +Ok +Ok +Forty two:42 +Forty two:42 diff --git a/shell/ash_test/ash-vars/var_unbackslash1.tests b/shell/ash_test/ash-vars/var_unbackslash1.tests index 8a9f2e2..cddd8ae 100755 --- a/shell/ash_test/ash-vars/var_unbackslash1.tests +++ b/shell/ash_test/ash-vars/var_unbackslash1.tests @@ -13,3 +13,23 @@ d' eval $e # "Ok" eval "$e" + +echo $\ +(echo Ok\ +) +echo "$\ +(echo Ok\ +)" + +echo Forty two:$\ +(\ +(\ +42\ +)\ +) +echo "Forty two:$\ +(\ +(\ +42\ +)\ +)"
\ No newline at end of file diff --git a/shell/hush_test/hush-vars/var_unbackslash1.right b/shell/hush_test/hush-vars/var_unbackslash1.right index 8d4eca3..3e0c0e2 100644 --- a/shell/hush_test/hush-vars/var_unbackslash1.right +++ b/shell/hush_test/hush-vars/var_unbackslash1.right @@ -1,3 +1,7 @@ Ok Ba d Ok +Ok +Ok +Forty two:42 +Forty two:42 diff --git a/shell/hush_test/hush-vars/var_unbackslash1.tests b/shell/hush_test/hush-vars/var_unbackslash1.tests index 8a9f2e2..cddd8ae 100755 --- a/shell/hush_test/hush-vars/var_unbackslash1.tests +++ b/shell/hush_test/hush-vars/var_unbackslash1.tests @@ -13,3 +13,23 @@ d' eval $e # "Ok" eval "$e" + +echo $\ +(echo Ok\ +) +echo "$\ +(echo Ok\ +)" + +echo Forty two:$\ +(\ +(\ +42\ +)\ +) +echo "Forty two:$\ +(\ +(\ +42\ +)\ +)"
\ No newline at end of file |