about summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-15 11:28:07 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-15 11:28:07 +0000
commit0e6f26551664f4aa6fa5b4bb5ae0638930f8cf0f (patch)
tree637f854aba35c18861e0ccc9a44fc820cf3d0cd9 /Src/loop.c
parentfdb4782642c7b030cd1972967fb4ed543949a3ee (diff)
downloadzsh-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/loop.c')
-rw-r--r--Src/loop.c4
1 files changed, 2 insertions, 2 deletions
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);