diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-10-15 11:28:07 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-10-15 11:28:07 +0000 |
commit | 0e6f26551664f4aa6fa5b4bb5ae0638930f8cf0f (patch) | |
tree | 637f854aba35c18861e0ccc9a44fc820cf3d0cd9 /Src | |
parent | fdb4782642c7b030cd1972967fb4ed543949a3ee (diff) | |
download | zsh-0e6f26551664f4aa6fa5b4bb5ae0638930f8cf0f.tar.gz zsh-0e6f26551664f4aa6fa5b4bb5ae0638930f8cf0f.tar.xz zsh-0e6f26551664f4aa6fa5b4bb5ae0638930f8cf0f.zip |
for caching of compiled patterns: remember that singsub() might modify the string it gets, compare with unmodified string (16041)
Diffstat (limited to 'Src')
-rw-r--r-- | Src/cond.c | 2 | ||||
-rw-r--r-- | Src/loop.c | 4 |
2 files changed, 3 insertions, 3 deletions
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); |