From 691547cda60f0512c645e80246292936e660f326 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Wed, 29 Oct 2014 08:45:57 -0700 Subject: 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. --- Src/Zle/complist.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Src/Zle') 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)) -- cgit 1.4.1