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

PATCH: 3.1.6-pre-1: remove variable warnings



I tweaked the code to remove two warnings about potential uses of
variables before they were defined.  I'm not sure if the first one
(for "cl" in complistmatches()) should be initialized to -1 or 0,
so I chose -1.  The initialization of "buf" (in getkeystring()) does
not appear to be required (upon casual inspection), but doesn't hurt.

..wayne..
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/Zle/complist.c
@@ -309,7 +309,7 @@
     Cexpl *e;
     int nlines = 0, ncols, nlist = 0, longest = 1, pnl = 0, opl = 0;
     int of = isset(LISTTYPES);
-    int mc, ml = 0, cc, hasm = 0, cl;
+    int mc, ml = 0, cc, hasm = 0, cl = -1;
     struct listcols col;
 
     if (minfo.asked == 2) {
Index: Src/utils.c
@@ -3202,7 +3202,7 @@
     int meta = 0, control = 0;
 
     if (fromwhere == 6)
-	t = tmp;
+	t = buf = tmp;
     else if (fromwhere != 4)
 	t = buf = zhalloc(strlen(s) + 1);
     else {
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---



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