From 883cdb79a440d0425766f67aaef0cabde0a5060e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 9 Jan 2021 08:27:37 +0100 Subject: ash: fix ${unset_var/pattern/repl} function old new delta subevalvar 1349 1353 +4 Signed-off-by: Denys Vlasenko --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell/ash.c') diff --git a/shell/ash.c b/shell/ash.c index 37f9dd71b..76bf39ec2 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 = '/'; -- cgit v1.2.3