diff options
author | Denys Vlasenko | 2021-01-09 08:27:37 +0100 |
---|---|---|
committer | Denys Vlasenko | 2021-01-09 08:27:37 +0100 |
commit | 883cdb79a440d0425766f67aaef0cabde0a5060e (patch) | |
tree | c90b5ef771bd4ef39c0ddf27c7a5229bbdde1194 /shell/ash.c | |
parent | cc4303f5e603f3212ede6965ee37609d2a386398 (diff) | |
download | busybox-883cdb79a440d0425766f67aaef0cabde0a5060e.zip busybox-883cdb79a440d0425766f67aaef0cabde0a5060e.tar.gz |
ash: fix ${unset_var/pattern/repl}
function old new delta
subevalvar 1349 1353 +4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 37f9dd7..76bf39e 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -7015,7 +7015,8 @@ subevalvar(char *start, char *str, int strloc, slash_pos = -1; if (repl) { slash_pos = expdest - ((char *)stackblock() + strloc); - STPUTC('/', expdest); + if (!(flag & EXP_DISCARD)) + STPUTC('/', expdest); //bb_error_msg("repl+1:'%s'", repl + 1); p = argstr(repl + 1, (flag & EXP_DISCARD) | EXP_TILDE); /* EXP_TILDE: echo "${v/x/~}" expands ~ ! */ *repl = '/'; |