summary refs log tree commit diff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index a9d57ae43..b13932e24 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -672,7 +672,7 @@ clnicezputs(Listcols colors, char *s, int ml)
     if (colors)
 	initiscol(colors);
 
-    while ((cc = *s)) {
+    while ((cc = *s++)) {
 	if (colors)
 	    doiscol(colors, i++);
 	if (itok(cc)) {
@@ -2153,9 +2153,15 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    if (y < mlines)
 		mline = y;
 	}
+	DPUTS(mline < 0,
+	      "BUG: mline < 0 after re-scanning mtab in domenuselect()");
 	while (mline < mlbeg)
-	    if ((mlbeg -= step) < 0)
+	    if ((mlbeg -= step) < 0) {
 		mlbeg = 0;
+		/* Crude workaround for BUG above */
+		if (mline < 0)
+		    break;
+	    }
 
 	if (mlbeg && lbeg != mlbeg) {
 	    Cmatch **p = mtab + ((mlbeg - 1) * columns), **q;