Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: 3.1.6-pre-1: remove variable warnings
- X-seq: zsh-workers 7180
- From: Wayne Davison <wayne@xxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: PATCH: 3.1.6-pre-1: remove variable warnings
- Date: Sat, 17 Jul 1999 17:09:47 -0700 (PDT)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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