diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-06 01:52:23 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-06 01:52:23 +0200 |
commit | 637982f5bbe7a5be4e5409ab0404df2583e7c299 (patch) | |
tree | 9a5301921387b7bd34ce3ae07ffe8c5f90b37f92 | |
parent | d13c1762a8d0ae70253b9775237cee64d02fae3b (diff) | |
download | busybox-w32-637982f5bbe7a5be4e5409ab0404df2583e7c299.tar.gz busybox-w32-637982f5bbe7a5be4e5409ab0404df2583e7c299.tar.bz2 busybox-w32-637982f5bbe7a5be4e5409ab0404df2583e7c299.zip |
hush: correctly handle quoting in "case" even if !BASH_PATTERN_SUBST
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index 7574e3918..aee77d03b 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -5189,7 +5189,7 @@ static struct pipe *parse_stream(char **pstring, | |||
5189 | /*** Execution routines ***/ | 5189 | /*** Execution routines ***/ |
5190 | 5190 | ||
5191 | /* Expansion can recurse, need forward decls: */ | 5191 | /* Expansion can recurse, need forward decls: */ |
5192 | #if !BASH_PATTERN_SUBST | 5192 | #if !BASH_PATTERN_SUBST && !ENABLE_HUSH_CASE |
5193 | /* only ${var/pattern/repl} (its pattern part) needs additional mode */ | 5193 | /* only ${var/pattern/repl} (its pattern part) needs additional mode */ |
5194 | #define expand_string_to_string(str, do_unbackslash) \ | 5194 | #define expand_string_to_string(str, do_unbackslash) \ |
5195 | expand_string_to_string(str) | 5195 | expand_string_to_string(str) |
@@ -5317,6 +5317,9 @@ static int expand_on_ifs(int *ended_with_ifs, o_string *output, int n, const cha | |||
5317 | #endif | 5317 | #endif |
5318 | static char *encode_then_expand_string(const char *str, int process_bkslash, int do_unbackslash) | 5318 | static char *encode_then_expand_string(const char *str, int process_bkslash, int do_unbackslash) |
5319 | { | 5319 | { |
5320 | #if !BASH_PATTERN_SUBST | ||
5321 | const int do_unbackslash = 1; | ||
5322 | #endif | ||
5320 | char *exp_str; | 5323 | char *exp_str; |
5321 | struct in_str input; | 5324 | struct in_str input; |
5322 | o_string dest = NULL_O_STRING; | 5325 | o_string dest = NULL_O_STRING; |
@@ -5936,7 +5939,7 @@ static char **expand_strvec_to_strvec_singleword_noglob(char **argv) | |||
5936 | */ | 5939 | */ |
5937 | static char *expand_string_to_string(const char *str, int do_unbackslash) | 5940 | static char *expand_string_to_string(const char *str, int do_unbackslash) |
5938 | { | 5941 | { |
5939 | #if !BASH_PATTERN_SUBST | 5942 | #if !BASH_PATTERN_SUBST && !ENABLE_HUSH_CASE |
5940 | const int do_unbackslash = 1; | 5943 | const int do_unbackslash = 1; |
5941 | #endif | 5944 | #endif |
5942 | char *argv[2], **list; | 5945 | char *argv[2], **list; |