ash: fix another bug detected by var_bash4.tests
... but var_bash4.tests still does not pass! function old new delta expandarg 959 962 +3 localcmd 259 257 -2 readtoken1 3275 3260 -15 subevalvar 1178 1141 -37 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 3/-54) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
c8d305d89f
commit
1614900522
@ -6272,6 +6272,8 @@ parse_sub_pattern(char *arg, int varflags)
|
|||||||
char *idx, *repl = NULL;
|
char *idx, *repl = NULL;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
|
//char *org_arg = arg;
|
||||||
|
//bb_error_msg("arg:'%s'", arg);
|
||||||
idx = arg;
|
idx = arg;
|
||||||
while (1) {
|
while (1) {
|
||||||
c = *arg;
|
c = *arg;
|
||||||
@ -6290,6 +6292,7 @@ parse_sub_pattern(char *arg, int varflags)
|
|||||||
arg++;
|
arg++;
|
||||||
}
|
}
|
||||||
*idx = c; /* NUL */
|
*idx = c; /* NUL */
|
||||||
|
//bb_error_msg("pattern:'%s' repl:'%s'", org_arg, repl);
|
||||||
|
|
||||||
return repl;
|
return repl;
|
||||||
}
|
}
|
||||||
@ -6499,8 +6502,6 @@ subevalvar(char *p, char *varname, int strloc, int subtype,
|
|||||||
//bb_error_msg("tail:'%s', quotes:%x", idx, quotes);
|
//bb_error_msg("tail:'%s', quotes:%x", idx, quotes);
|
||||||
while (*idx) {
|
while (*idx) {
|
||||||
char *restart_detect = stackblock();
|
char *restart_detect = stackblock();
|
||||||
if (quotes && (unsigned char)*idx == CTLESC)
|
|
||||||
idx++;
|
|
||||||
STPUTC(*idx, expdest);
|
STPUTC(*idx, expdest);
|
||||||
if (stackblock() != restart_detect)
|
if (stackblock() != restart_detect)
|
||||||
goto restart;
|
goto restart;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user