Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug? in complist when filenames are longer than the screen
- X-seq: zsh-workers 21818
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: DervishD <zsh@xxxxxxxxxxxx>
- Subject: Re: Bug? in complist when filenames are longer than the screen
- Date: Tue, 04 Oct 2005 02:07:17 +0000
- Cc: Zsh Workers <zsh-workers@xxxxxxxxxx>
- In-reply-to: <20051003184822.GA3240@DervishD>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20051003144536.GA3179@DervishD> <200510032145.07748.arvidjaar@xxxxxxxxxx> <20051003184822.GA3240@DervishD>
On Oct 3, 8:48pm, DervishD wrote:
}
} The above, when run after "zsh -f" and making sure you don't have
} any /etc/zshenv not protected by "[[ -o rcs ]]", causes a hangup (not
} a crash) in my system. Unfortunately the crash happens randomly
See if the following patch reduces the problem to something reproducible.
I don't really know what the problem is, but all of the following are
defensive changes against possible infinite loops.
Index: Src/Zle/complist.c
--- current/Src/Zle/complist.c Sun Oct 2 18:38:17 2005
+++ Src/Zle/complist.c Mon Oct 3 19:02:17 2005
@@ -831,7 +831,7 @@
selectlocalmap(NULL);
settyinfo(&shttyinfo);
putc('\r', shout);
- for (i = columns - 1; i--; )
+ for (i = columns - 1; i-- > 0; )
putc(' ', shout);
putc('\r', shout);
@@ -1148,7 +1148,7 @@
if (mselect >= 0) {
int mm = (mcols * ml), i;
- for (i = mcols; i--; ) {
+ for (i = mcols; i-- > 0; ) {
mtab[mm + i] = mtmark(NULL);
mgtab[mm + i] = mgmark(NULL);
}
@@ -1469,12 +1469,12 @@
int mm = (mcols * ml), i;
if (m->flags & CMF_DUMMY) {
- for (i = mcols; i--; ) {
+ for (i = mcols; i-- > 0; ) {
mtab[mm + i] = mtmark(mp);
mgtab[mm + i] = mgmark(g);
}
} else {
- for (i = mcols; i--; ) {
+ for (i = mcols; i-- > 0; ) {
mtab[mm + i] = mp;
mgtab[mm + i] = g;
}
@@ -1523,12 +1523,12 @@
int mm = mcols * ml, i;
if (m->flags & CMF_DUMMY) {
- for (i = (width ? width : mcols); i--; ) {
+ for (i = (width ? width : mcols); i-- > 0; ) {
mtab[mx + mm + i] = mtmark(mp);
mgtab[mx + mm + i] = mgmark(g);
}
} else {
- for (i = (width ? width : mcols); i--; ) {
+ for (i = (width ? width : mcols); i-- > 0; ) {
mtab[mx + mm + i] = mp;
mgtab[mx + mm + i] = g;
}
@@ -2142,7 +2142,7 @@
Cmatch **p = mtab;
for (y = 0; y < mlines; y++) {
- for (x = mcols; x; x--, p++)
+ for (x = mcols; x > 0; x--, p++)
if (*p && !mmarked(*p) && **p && mselect == (**p)->gnum)
break;
if (x) {
@@ -2162,7 +2162,7 @@
int c;
while (mlbeg) {
- for (q = p, c = columns; c; q++, c--)
+ for (q = p, c = columns; c > 0; q++, c--)
if (*q && !mmarked(*q))
break;
if (c)
@@ -2180,7 +2180,7 @@
int c;
while (mlbeg < mlines) {
- for (q = p, c = columns; c; q++, c--)
+ for (q = p, c = columns; c > 0; q++, c--)
if (*q)
break;
if (c)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author