diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-05 17:04:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-05 17:04:53 +0200 |
commit | de0262598504f55251e3763e73f259074795de5d (patch) | |
tree | d645d8206b8436031934424d55c9941f237f1d64 | |
parent | f2ed39b93075f384f9e82f5130f94174b05dc300 (diff) | |
download | busybox-w32-de0262598504f55251e3763e73f259074795de5d.tar.gz busybox-w32-de0262598504f55251e3763e73f259074795de5d.tar.bz2 busybox-w32-de0262598504f55251e3763e73f259074795de5d.zip |
hush: update to correctly handle changed var_bash[346].tests
function old new delta
expand_one_var 1612 1604 -8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/hush.c b/shell/hush.c index 42e311839..9ea3e3fcb 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -5961,11 +5961,11 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha | |||
5961 | /* pattern uses non-standard expansion. | 5961 | /* pattern uses non-standard expansion. |
5962 | * repl should be unbackslashed and globbed | 5962 | * repl should be unbackslashed and globbed |
5963 | * by the usual expansion rules: | 5963 | * by the usual expansion rules: |
5964 | * >az; >bz; | 5964 | * >az >bz |
5965 | * v='a bz'; echo "${v/a*z/a*z}" prints "a*z" | 5965 | * v='a bz'; echo "${v/a*z/a*z}" #prints "a*z" |
5966 | * v='a bz'; echo "${v/a*z/\z}" prints "\z" | 5966 | * v='a bz'; echo "${v/a*z/\z}" #prints "z" |
5967 | * v='a bz'; echo ${v/a*z/a*z} prints "az" | 5967 | * v='a bz'; echo ${v/a*z/a*z} #prints "az" |
5968 | * v='a bz'; echo ${v/a*z/\z} prints "z" | 5968 | * v='a bz'; echo ${v/a*z/\z} #prints "z" |
5969 | * (note that a*z _pattern_ is never globbed!) | 5969 | * (note that a*z _pattern_ is never globbed!) |
5970 | */ | 5970 | */ |
5971 | char *pattern, *repl, *t; | 5971 | char *pattern, *repl, *t; |
@@ -5977,7 +5977,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha | |||
5977 | exp_word = p; | 5977 | exp_word = p; |
5978 | p = strchr(p, SPECIAL_VAR_SYMBOL); | 5978 | p = strchr(p, SPECIAL_VAR_SYMBOL); |
5979 | *p = '\0'; | 5979 | *p = '\0'; |
5980 | repl = encode_then_expand_string(exp_word, /*process_bkslash:*/ arg0 & 0x80, /*unbackslash:*/ 1); | 5980 | repl = encode_then_expand_string(exp_word, /*process_bkslash:*/ 0, /*unbackslash:*/ 1); |
5981 | debug_printf_varexp("repl:'%s'->'%s'\n", exp_word, repl); | 5981 | debug_printf_varexp("repl:'%s'->'%s'\n", exp_word, repl); |
5982 | /* HACK ALERT. We depend here on the fact that | 5982 | /* HACK ALERT. We depend here on the fact that |
5983 | * G.global_argv and results of utoa and get_local_var_value | 5983 | * G.global_argv and results of utoa and get_local_var_value |