diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-06 22:06:21 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-06 22:06:21 +0200 |
commit | 1614900522a5d603909a2679acbdd4744c235c1b (patch) | |
tree | 8a9892d7487a0d3c9db9367da4970d89aacb6e94 | |
parent | c8d305d89f06e0d6612b7acdc91cb8775f5667b1 (diff) | |
download | busybox-w32-1614900522a5d603909a2679acbdd4744c235c1b.tar.gz busybox-w32-1614900522a5d603909a2679acbdd4744c235c1b.tar.bz2 busybox-w32-1614900522a5d603909a2679acbdd4744c235c1b.zip |
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>
-rw-r--r-- | shell/ash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 74b1c3aad..dcac4fe04 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -6272,6 +6272,8 @@ parse_sub_pattern(char *arg, int varflags) | |||
6272 | char *idx, *repl = NULL; | 6272 | char *idx, *repl = NULL; |
6273 | unsigned char c; | 6273 | unsigned char c; |
6274 | 6274 | ||
6275 | //char *org_arg = arg; | ||
6276 | //bb_error_msg("arg:'%s'", arg); | ||
6275 | idx = arg; | 6277 | idx = arg; |
6276 | while (1) { | 6278 | while (1) { |
6277 | c = *arg; | 6279 | c = *arg; |
@@ -6290,6 +6292,7 @@ parse_sub_pattern(char *arg, int varflags) | |||
6290 | arg++; | 6292 | arg++; |
6291 | } | 6293 | } |
6292 | *idx = c; /* NUL */ | 6294 | *idx = c; /* NUL */ |
6295 | //bb_error_msg("pattern:'%s' repl:'%s'", org_arg, repl); | ||
6293 | 6296 | ||
6294 | return repl; | 6297 | return repl; |
6295 | } | 6298 | } |
@@ -6499,8 +6502,6 @@ subevalvar(char *p, char *varname, int strloc, int subtype, | |||
6499 | //bb_error_msg("tail:'%s', quotes:%x", idx, quotes); | 6502 | //bb_error_msg("tail:'%s', quotes:%x", idx, quotes); |
6500 | while (*idx) { | 6503 | while (*idx) { |
6501 | char *restart_detect = stackblock(); | 6504 | char *restart_detect = stackblock(); |
6502 | if (quotes && (unsigned char)*idx == CTLESC) | ||
6503 | idx++; | ||
6504 | STPUTC(*idx, expdest); | 6505 | STPUTC(*idx, expdest); |
6505 | if (stackblock() != restart_detect) | 6506 | if (stackblock() != restart_detect) |
6506 | goto restart; | 6507 | goto restart; |