diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Src/cond.c | 2 | ||||
-rw-r--r-- | Src/loop.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index bdeb75ab3..fa5028100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-15 Sven Wischnowsky <wischnow@zsh.org> + + * Bart: 16038 and 16041: Src/cond.c, Src/loop.c: for caching of + compiled patterns: remember that singsub() might modify the string + it gets, compare with unmodified string + 2001-10-14 Bart Schaefer <schaefer@zsh.org> * 16031: Src/Modules/tcp.c: Don't need <arpa/telnet.h>; misc. diff --git a/Src/cond.c b/Src/cond.c index 8a54eeeb2..b34a14be1 100644 --- a/Src/cond.c +++ b/Src/cond.c @@ -202,7 +202,7 @@ evalcond(Estate state) char *opat; int save; - right = opat = dupstring(ecrawstr(state->prog, state->pc, + right = dupstring(opat = ecrawstr(state->prog, state->pc, &htok)); if (htok) singsub(&right); diff --git a/Src/loop.c b/Src/loop.c index 38eeda7d6..57ee11695 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -543,7 +543,7 @@ execcase(Estate state, int do_exec) if (isset(XTRACE)) { char *pat2, *opat; - opat = pat = ecgetstr(state, EC_DUP, NULL); + pat = dupstring(opat = ecrawstr(state->prog, state->pc, NULL)); singsub(&pat); save = (!(state->prog->flags & EF_HEAP) && !strcmp(pat, opat) && *spprog != dummy_patprog2); @@ -565,7 +565,7 @@ execcase(Estate state, int do_exec) char *opat; int htok = 0; - opat = pat = dupstring(ecrawstr(state->prog, + pat = dupstring(opat = ecrawstr(state->prog, state->pc - 2, &htok)); if (htok) singsub(&pat); |