about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-20 10:56:27 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-20 10:56:27 +0000
commit1e0379ae2532e6398772147e0ba7320ac35e4dd1 (patch)
tree514bdb8fcfdeb7d20185fa58fb431e52282da9c5
parent0de287ce9416cb5c2be8090bae3b7c89b2cd8b2a (diff)
downloadzsh-1e0379ae2532e6398772147e0ba7320ac35e4dd1.tar.gz
zsh-1e0379ae2532e6398772147e0ba7320ac35e4dd1.tar.xz
zsh-1e0379ae2532e6398772147e0ba7320ac35e4dd1.zip
(15433)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a1f9dbab..4fe0878a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-20  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 15433: Src/Zle/computil.c: don't use compsuffix when it might
+	be freed; use the right variable in that loop there, dammit
+
 2001-07-18  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 15402 (Akinora Musha): Completion/Unix/Command/_cvs: add
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 870bbcce8..155c883f6 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2525,19 +2525,21 @@ cv_parse_word(Cvdef d)
                     ign = strlen(as);
             }
         }
+        more = dupstring(more);
+
         if (ign)
             ignore_suffix(ign);
 
         while (more && *more) {
-            if ((val = cv_next(d, &str, &arg))) {
+            if ((val = cv_next(d, &more, &arg))) {
                 zaddlinknode(state.vals, ztrdup(val->name));
                 if (arg) {
-                    if (str) {
-                        char sav = str[-1];
+                    if (more) {
+                        char sav = more[-1];
 
-                        str[-1] = '\0';
+                        more[-1] = '\0';
                         zaddlinknode(state.vals, ztrdup(arg));
-                        str[-1] = sav;
+                        more[-1] = sav;
                     } else {
                         zaddlinknode(state.vals, tricat(arg, compsuffix, ""));
                         nosfx = 1;