about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-10-29 08:45:57 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-10-29 08:45:57 -0700
commit691547cda60f0512c645e80246292936e660f326 (patch)
tree4462acf2ff7debdd7438e4dff3c36f82cfb1d598 /Src/Zle
parent0412c0baaa8aab99dc59913614f42471091712b0 (diff)
downloadzsh-691547cda60f0512c645e80246292936e660f326.tar.gz
zsh-691547cda60f0512c645e80246292936e660f326.tar.xz
zsh-691547cda60f0512c645e80246292936e660f326.zip
33563: Completion/Base/Core/_main_complete, Src/Zle/complist.c: fix thinko in status message for INT/QUIT signals; check errflag in output loops
Two semi-related patches for keyboard interrupt handling in completion,
most importantly so that unexpectedly long completion listings can be
interrupted.
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/complist.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 5e5ba9f20..2e1a5273c 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1375,7 +1375,7 @@ compprintlist(int showall)
 	tcout(TCCLEAREOD);
 
     g = ((lasttype && lastg) ? lastg : amatches);
-    while (g) {
+    while (g && !errflag) {
 	char **pp = g->ylist;
 
 #ifdef ZSH_HEAP_DEBUG
@@ -1389,7 +1389,7 @@ compprintlist(int showall)
 		ml = lastml;
 		lastused = 1;
 	    }
-	    while (*e) {
+	    while (*e && !errflag) {
 		if (((*e)->count || (*e)->always) &&
 		    (!listdat.onlyexpl ||
 		     (listdat.onlyexpl & ((*e)->always > 0 ? 2 : 1)))) {
@@ -1469,11 +1469,11 @@ compprintlist(int showall)
 
 		nl = nc = g->lins;
 
-		while (n && nl--) {
+		while (n && nl-- && !errflag) {
 		    i = g->cols;
 		    mc = 0;
 		    pq = pp;
-		    while (n && i--) {
+		    while (n && i-- && !errflag) {
 			if (pq - g->ylist >= g->lcount)
 			    break;
 			if (compzputs(*pq, mscroll))
@@ -1582,7 +1582,7 @@ compprintlist(int showall)
 	    } else
 		p = skipnolist(g->matches, showall);
 
-	    while (n && nl--) {
+	    while (n && nl-- && !errflag) {
 		if (!lasttype && ml >= mlbeg) {
 		    lasttype = 3;
 		    lastg = g;
@@ -1596,7 +1596,7 @@ compprintlist(int showall)
 		i = g->cols;
 		mc = 0;
 		q = p;
-		while (n && i--) {
+		while (n && i-- && !errflag) {
 		    wid = (g->widths ? g->widths[mc] : g->width);
 		    if (!(m = *q)) {
 			if (clprintm(g, NULL, mc, ml, (!i), wid))