diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-05 23:12:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-05 23:12:15 +0200 |
commit | bd43c6784fb53826806c7cb51a1ed54e95eb4be9 (patch) | |
tree | 8b250b2eaa4781af90a4c4b6702903b11cdf7f24 /shell/hush.c | |
parent | 4142f0187dcf8454e8d2a8d16b321dbd573c170e (diff) | |
download | busybox-w32-bd43c6784fb53826806c7cb51a1ed54e95eb4be9.tar.gz busybox-w32-bd43c6784fb53826806c7cb51a1ed54e95eb4be9.tar.bz2 busybox-w32-bd43c6784fb53826806c7cb51a1ed54e95eb4be9.zip |
hush: fix quoted_punct.tests failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index 30add72f0..7574e3918 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -5969,7 +5969,7 @@ static char *expand_string_to_string(const char *str, int do_unbackslash) | |||
5969 | return (char*)list; | 5969 | return (char*)list; |
5970 | } | 5970 | } |
5971 | 5971 | ||
5972 | /* Used for "eval" builtin */ | 5972 | /* Used for "eval" builtin and case string */ |
5973 | static char* expand_strvec_to_string(char **argv) | 5973 | static char* expand_strvec_to_string(char **argv) |
5974 | { | 5974 | { |
5975 | char **list; | 5975 | char **list; |
@@ -8053,6 +8053,7 @@ static int run_list(struct pipe *pi) | |||
8053 | if (rword == RES_CASE) { | 8053 | if (rword == RES_CASE) { |
8054 | debug_printf_exec("CASE cond_code:%d\n", cond_code); | 8054 | debug_printf_exec("CASE cond_code:%d\n", cond_code); |
8055 | case_word = expand_strvec_to_string(pi->cmds->argv); | 8055 | case_word = expand_strvec_to_string(pi->cmds->argv); |
8056 | unbackslash(case_word); | ||
8056 | continue; | 8057 | continue; |
8057 | } | 8058 | } |
8058 | if (rword == RES_MATCH) { | 8059 | if (rword == RES_MATCH) { |
@@ -8064,9 +8065,10 @@ static int run_list(struct pipe *pi) | |||
8064 | /* all prev words didn't match, does this one match? */ | 8065 | /* all prev words didn't match, does this one match? */ |
8065 | argv = pi->cmds->argv; | 8066 | argv = pi->cmds->argv; |
8066 | while (*argv) { | 8067 | while (*argv) { |
8067 | char *pattern = expand_string_to_string(*argv, /*unbackslash:*/ 1); | 8068 | char *pattern = expand_string_to_string(*argv, /*unbackslash:*/ 0); |
8068 | /* TODO: which FNM_xxx flags to use? */ | 8069 | /* TODO: which FNM_xxx flags to use? */ |
8069 | cond_code = (fnmatch(pattern, case_word, /*flags:*/ 0) != 0); | 8070 | cond_code = (fnmatch(pattern, case_word, /*flags:*/ 0) != 0); |
8071 | debug_printf_exec("fnmatch(pattern:'%s',str:'%s'):%d\n", pattern, case_word, cond_code); | ||
8070 | free(pattern); | 8072 | free(pattern); |
8071 | if (cond_code == 0) { /* match! we will execute this branch */ | 8073 | if (cond_code == 0) { /* match! we will execute this branch */ |
8072 | free(case_word); | 8074 | free(case_word); |