From: Ron Yorston Date: Sun, 3 Apr 2016 21:43:14 +0000 (+0100) Subject: ash: bash-compatible $'...' shouldn't expand in double quotes X-Git-Tag: 1_25_0~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=84ba50c32f7dbfccddd5c5ca34d48d97c3f72193;p=oweals%2Fbusybox.git ash: bash-compatible $'...' shouldn't expand in double quotes Bash doesn't expand its $'...' construct in double quotes: $ echo "$'a\tb'" $'a\tb' Change BusyBox ash to do the same. This also fixes a problem with here documents where BusyBox ash gave an incorrect result for: $ cat < '$' > EOF '$' Reported-by: Timo Teras Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- diff --git a/shell/ash.c b/shell/ash.c index 13eeab34b..da9c95045 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11500,7 +11500,7 @@ parsesub: { || (c != '(' && c != '{' && !is_name(c) && !is_special(c)) ) { #if ENABLE_ASH_BASH_COMPAT - if (c == '\'') + if (syntax != DQSYNTAX && c == '\'') bash_dollar_squote = 1; else #endif diff --git a/shell/ash_test/ash-heredoc/heredoc4.right b/shell/ash_test/ash-heredoc/heredoc4.right new file mode 100644 index 000000000..371b092e2 --- /dev/null +++ b/shell/ash_test/ash-heredoc/heredoc4.right @@ -0,0 +1 @@ +'$' diff --git a/shell/ash_test/ash-heredoc/heredoc4.tests b/shell/ash_test/ash-heredoc/heredoc4.tests new file mode 100755 index 000000000..642ddb324 --- /dev/null +++ b/shell/ash_test/ash-heredoc/heredoc4.tests @@ -0,0 +1,3 @@ +cat <