ash: fix ${unset_var/pattern/repl}
function old new delta subevalvar 1349 1353 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
cc4303f5e6
commit
883cdb79a4
@ -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 = '/';
|
||||
|
@ -1,2 +1,3 @@
|
||||
|
||||
|
||||
Ok:0
|
||||
|
@ -1,3 +1,5 @@
|
||||
unset v
|
||||
echo ${v/*/w}
|
||||
v=''
|
||||
echo ${v/*/w}
|
||||
echo Ok:$?
|
||||
|
Loading…
Reference in New Issue
Block a user