summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 299f3ca98..5c4fc3ed5 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2615,19 +2615,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;