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;
|
slash_pos = -1;
|
||||||
if (repl) {
|
if (repl) {
|
||||||
slash_pos = expdest - ((char *)stackblock() + strloc);
|
slash_pos = expdest - ((char *)stackblock() + strloc);
|
||||||
STPUTC('/', expdest);
|
if (!(flag & EXP_DISCARD))
|
||||||
|
STPUTC('/', expdest);
|
||||||
//bb_error_msg("repl+1:'%s'", repl + 1);
|
//bb_error_msg("repl+1:'%s'", repl + 1);
|
||||||
p = argstr(repl + 1, (flag & EXP_DISCARD) | EXP_TILDE); /* EXP_TILDE: echo "${v/x/~}" expands ~ ! */
|
p = argstr(repl + 1, (flag & EXP_DISCARD) | EXP_TILDE); /* EXP_TILDE: echo "${v/x/~}" expands ~ ! */
|
||||||
*repl = '/';
|
*repl = '/';
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
Ok:0
|
Ok:0
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
unset v
|
||||||
|
echo ${v/*/w}
|
||||||
v=''
|
v=''
|
||||||
echo ${v/*/w}
|
echo ${v/*/w}
|
||||||
echo Ok:$?
|
echo Ok:$?
|
||||||
|
Loading…
Reference in New Issue
Block a user