Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Segfault on "task <Tab><Tab>" with zsh 5.0.2 [PATCH]



On Sep 19,  9:49am, Peter Stephenson wrote:
}
} The way i is decremented and p incremented at different points makes it
} very difficult to see what's going on --- I suspect there's an argument
} for moving the decrement just for clarity but this fix will do fine.

I believe get_cadef is going to have the same bug, it uses the identical
technique for managing its cache.

diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 2c323ee..f8983c3 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1608,7 +1608,7 @@ get_cadef(char *nam, char **args)
 	    return *p;
 	} else if (!min || !*p || (*p)->lastt < (*min)->lastt)
 	    min = p;
-    if (i)
+    if (i > 0)
 	min = p;
     if ((new = parse_cadef(nam, args))) {
 	freecadef(*min);

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author