Commit d8936173 authored by Peter Stephenson's avatar Peter Stephenson

29165: use term.h globally if needed at all.

parent 70fd751a
2011-05-09 Peter Stephenson <pws@csr.com>
* 29165: Src/builtin.c, Src/exec.c, Src/glob.c, Src/hashtable.c,
Src/init.c, Src/jobs.c, Src/loop.c, Src/params.c, Src/prompt.c,
Src/system.h, Src/utils.c, Src/Modules/files.c,
Src/Modules/termcap.c, Src/Modules/zpty.c, Src/Zle/comp.h,
Src/Zle/complist.c, Src/Zle/compmatch.c, Src/Zle/compresult.c,
Src/Zle/computil.c, Src/Zle/zle_refresh.c, Src/Zle/zle_tricky.c,
Src/Zle/zle_utils.c: Use term.h globally if needed, instead of
just using in Modules and fudging the headers elsewhere. Fix
various name clashes.
2011-05-08 Barton E. Schaefer <schaefer@zsh.org>
* users/15986 (belated commit): Src/Modules/curses.c: handle
......@@ -14612,5 +14624,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5283 $
* $Revision: 1.5284 $
*****************************************************
......@@ -195,7 +195,7 @@ bin_rmdir(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
static int
bin_ln(char *nam, char **args, Options ops, int func)
{
MoveFunc move;
MoveFunc movefn;
int flags, have_dir, err = 0;
char **a, *ptr, *rp, *buf;
struct stat st;
......@@ -203,7 +203,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
if(func == BIN_MV) {
move = (MoveFunc) rename;
movefn = (MoveFunc) rename;
flags = OPT_ISSET(ops,'f') ? 0 : MV_ASKNW;
flags |= MV_ATOMIC;
} else {
......@@ -212,11 +212,11 @@ bin_ln(char *nam, char **args, Options ops, int func)
if(OPT_ISSET(ops,'h') || OPT_ISSET(ops,'n'))
flags |= MV_NOCHASETARGET;
if(OPT_ISSET(ops,'s'))
move = (MoveFunc) symlink;
movefn = (MoveFunc) symlink;
else
#endif
{
move = (MoveFunc) link;
movefn = (MoveFunc) link;
if(!OPT_ISSET(ops,'d'))
flags |= MV_NODIRS;
}
......@@ -267,7 +267,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
else
args[1] = args[0];
}
return domove(nam, move, args[0], args[1], flags);
return domove(nam, movefn, args[0], args[1], flags);
havedir:
buf = ztrdup(*a);
*a = NULL;
......@@ -283,7 +283,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
buf[blen] = 0;
buf = appstr(buf, ptr);
err |= domove(nam, move, *args, buf, flags);
err |= domove(nam, movefn, *args, buf, flags);
}
zsfree(buf);
return err;
......@@ -291,7 +291,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
/**/
static int
domove(char *nam, MoveFunc move, char *p, char *q, int flags)
domove(char *nam, MoveFunc movefn, char *p, char *q, int flags)
{
struct stat st;
char *pbuf, *qbuf;
......@@ -341,7 +341,7 @@ domove(char *nam, MoveFunc move, char *p, char *q, int flags)
if(doit && !(flags & MV_ATOMIC))
unlink(qbuf);
}
if(move(pbuf, qbuf)) {
if(movefn(pbuf, qbuf)) {
zwarnnam(nam, "%s: %e", p, errno);
zsfree(pbuf);
return 1;
......
......@@ -35,34 +35,11 @@
*/
#include "../../config.h"
#ifdef HAVE_TGETENT
# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H)
# define USES_TERM_H 1
# else
# ifdef HAVE_TERMCAP_H
# define USES_TERMCAP_H 1
# endif
# endif
#endif
#include "termcap.mdh"
#include "termcap.pro"
/**/
#ifdef HAVE_TGETENT
# ifdef USES_TERM_H
# ifdef HAVE_TERMIO_H
# include <termio.h>
# endif
# ifdef ZSH_HAVE_CURSES_H
# include "../zshcurses.h"
# endif
# include "../zshterm.h"
# else
# ifdef USES_TERMCAP_H
# include <termcap.h>
# endif
# endif
#ifndef HAVE_BOOLCODES
static char *boolcodes[] = {
......
......@@ -351,8 +351,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
struct ttyinfo info;
if (ioctl(slave, TIOCGWINSZ, (char *) &info.winsize) == 0) {
info.winsize.ws_row = lines;
info.winsize.ws_col = columns;
info.winsize.ws_row = zterm_lines;
info.winsize.ws_col = zterm_columns;
ioctl(slave, TIOCSWINSZ, (char *) &info.winsize);
}
}
......
......@@ -323,8 +323,8 @@ struct cadata {
typedef struct cldata *Cldata;
struct cldata {
int columns; /* screen width */
int lines; /* screen height */
int zterm_columns; /* screen width */
int zterm_lines; /* screen height */
int menuacc; /* value of global menuacc */
int valid; /* no need to calculate anew */
int nlist; /* number of matches to list */
......
This diff is collapsed.
......@@ -1268,7 +1268,7 @@ pattern_match_equivalence(Cpattern lp, convchar_t wind, int wmtp,
/**/
static int
pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen,
Cpattern prestrict, ZLE_STRING_T newline)
Cpattern prestrict, ZLE_STRING_T new_line)
{
convchar_t c;
convchar_t ind, wind;
......@@ -1356,7 +1356,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen,
}
/* We need to assemble the line */
*newline++ = (ZLE_CHAR_T)c;
*new_line++ = (ZLE_CHAR_T)c;
prestrict = prestrict->next;
wsc++;
wsclen--;
......@@ -1393,7 +1393,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen,
if (!pattern_match1(p, c, &mt))
return 0;
p = p->next;
*newline++ = (ZLE_CHAR_T)c;
*new_line++ = (ZLE_CHAR_T)c;
prestrict = prestrict->next;
}
......
......@@ -1473,13 +1473,14 @@ calclist(int showall)
if (lastinvcount == invcount &&
listdat.valid && onlyexpl == listdat.onlyexpl &&
menuacc == listdat.menuacc && showall == listdat.showall &&
lines == listdat.lines && columns == listdat.columns)
zterm_lines == listdat.zterm_lines &&
zterm_columns == listdat.zterm_columns)
return 0;
lastinvcount = invcount;
for (g = amatches; g; g = g->next) {
char **pp = g->ylist;
int nl = 0, l, glong = 1, gshort = columns, ndisp = 0, totl = 0;
int nl = 0, l, glong = 1, gshort = zterm_columns, ndisp = 0, totl = 0;
int hasf = 0;
g->flags |= CGF_PACKED | CGF_ROWS;
......@@ -1495,7 +1496,7 @@ calclist(int showall)
/* We have an ylist, lets see, if it contains newlines. */
hidden = 1;
while (!nl && *pp) {
if (MB_METASTRWIDTH(*pp) >= columns)
if (MB_METASTRWIDTH(*pp) >= zterm_columns)
nl = 1;
else
nl = !!strchr(*pp++, '\n');
......@@ -1511,11 +1512,12 @@ calclist(int showall)
while (*sptr) {
if ((nlptr = strchr(sptr, '\n'))) {
*nlptr = '\0';
nlines += 1 + (MB_METASTRWIDTH(sptr)-1) / columns;
nlines += 1 + (MB_METASTRWIDTH(sptr)-1) /
zterm_columns;
*nlptr = '\n';
sptr = nlptr + 1;
} else {
nlines += (MB_METASTRWIDTH(sptr)-1) / columns;
nlines += (MB_METASTRWIDTH(sptr)-1) / zterm_columns;
break;
}
}
......@@ -1607,7 +1609,7 @@ calclist(int showall)
g->dcount = ndisp;
g->width = glong + CM_SPACE;
g->shortest = gshort + CM_SPACE;
if ((g->cols = columns / g->width) > g->dcount)
if ((g->cols = zterm_columns / g->width) > g->dcount)
g->cols = g->dcount;
if (g->cols) {
i = g->cols * g->width - CM_SPACE;
......@@ -1636,9 +1638,10 @@ calclist(int showall)
} else {
g->cols = 1;
g->width = 1;
while (*pp)
glines += 1 + (MB_METASTRWIDTH(*pp++) / columns);
glines += 1 + (MB_METASTRWIDTH(*pp++) /
zterm_columns);
}
}
} else {
......@@ -1650,15 +1653,17 @@ calclist(int showall)
} else if (!(g->flags & CGF_LINES)) {
g->cols = 1;
g->width = 0;
for (p = g->matches; (m = *p); p++)
if (!(m->flags & CMF_HIDE)) {
if (m->disp) {
if (!(m->flags & CMF_DISPLINE))
glines += 1 + ((mlens[m->gnum] - 1) / columns);
glines += 1 + ((mlens[m->gnum] - 1) /
zterm_columns);
} else if (showall ||
!(m->flags & (CMF_NOLIST | CMF_MULT)))
glines += 1 + (((mlens[m->gnum]) - 1) / columns);
glines += 1 + (((mlens[m->gnum]) - 1) /
zterm_columns);
}
}
}
......@@ -1669,8 +1674,8 @@ calclist(int showall)
if (!(g->flags & CGF_PACKED))
continue;
ws = g->widths = (int *) zalloc(columns * sizeof(int));
memset(ws, 0, columns * sizeof(int));
ws = g->widths = (int *) zalloc(zterm_columns * sizeof(int));
memset(ws, 0, zterm_columns * sizeof(int));
tlines = g->lins;
tcols = g->cols;
width = 0;
......@@ -1686,14 +1691,14 @@ calclist(int showall)
if (g->flags & CGF_ROWS) {
int nth, tcol, len;
for (tcols = columns / (g->shortest + CM_SPACE);
for (tcols = zterm_columns / (g->shortest + CM_SPACE);
tcols > g->cols;
tcols--) {
memset(ws, 0, tcols * sizeof(int));
for (width = nth = tcol = 0, tlines = 1;
width < columns && nth < g->dcount;
width < zterm_columns && nth < g->dcount;
nth++, tcol++) {
m = *p;
......@@ -1709,13 +1714,13 @@ calclist(int showall)
ws[tcol] = len;
}
}
if (width < columns)
if (width < zterm_columns)
break;
}
} else {
int nth, tcol, tline, len;
for (tcols = columns / (g->shortest + CM_SPACE);
for (tcols = zterm_columns / (g->shortest + CM_SPACE);
tcols > g->cols;
tcols--) {
......@@ -1725,7 +1730,7 @@ calclist(int showall)
memset(ws, 0, tcols * sizeof(int));
for (width = nth = tcol = tline = 0;
width < columns && nth < g->dcount;
width < zterm_columns && nth < g->dcount;
nth++, tline++) {
m = *p;
......@@ -1745,7 +1750,7 @@ calclist(int showall)
ws[tcol] = len;
}
}
if (width < columns)
if (width < zterm_columns)
break;
}
}
......@@ -1754,7 +1759,7 @@ calclist(int showall)
if (g->flags & CGF_ROWS) {
int nth, tcol, len;
for (tcols = columns / (g->shortest + CM_SPACE);
for (tcols = zterm_columns / (g->shortest + CM_SPACE);
tcols > g->cols;
tcols--) {
......@@ -1762,7 +1767,7 @@ calclist(int showall)
for (width = nth = tcol = 0, tlines = 1,
p = skipnolist(g->matches, showall);
*p && width < columns && nth < g->dcount;
*p && width < zterm_columns && nth < g->dcount;
nth++, p = skipnolist(p + 1, showall), tcol++) {
m = *p;
......@@ -1779,13 +1784,13 @@ calclist(int showall)
ws[tcol] = len;
}
}
if (width < columns)
if (width < zterm_columns)
break;
}
} else {
int nth, tcol, tline, len;
for (tcols = columns / (g->shortest + CM_SPACE);
for (tcols = zterm_columns / (g->shortest + CM_SPACE);
tcols > g->cols;
tcols--) {
......@@ -1796,7 +1801,7 @@ calclist(int showall)
for (width = nth = tcol = tline = 0,
p = skipnolist(g->matches, showall);
*p && width < columns && nth < g->dcount;
*p && width < zterm_columns && nth < g->dcount;
nth++, p = skipnolist(p + 1, showall), tline++) {
m = *p;
......@@ -1817,7 +1822,7 @@ calclist(int showall)
ws[tcol] = len;
}
}
if (width < columns) {
if (width < zterm_columns) {
if (++tcol < tcols)
tcols = tcol;
break;
......@@ -1828,7 +1833,7 @@ calclist(int showall)
if (tcols <= g->cols)
tlines = g->lins;
if (tlines == g->lins) {
zfree(ws, columns * sizeof(int));
zfree(ws, zterm_columns * sizeof(int));
g->widths = NULL;
} else {
nlines += tlines - g->lins;
......@@ -1862,8 +1867,8 @@ calclist(int showall)
listdat.nlines = nlines;
listdat.menuacc = menuacc;
listdat.onlyexpl = onlyexpl;
listdat.columns = columns;
listdat.lines = lines;
listdat.zterm_columns = zterm_columns;
listdat.zterm_lines = zterm_lines;
listdat.showall = showall;
return 1;
......@@ -1884,7 +1889,7 @@ asklist(void)
if ((!minfo.cur || !minfo.asked) &&
((complistmax > 0 && listdat.nlist >= complistmax) ||
(complistmax < 0 && listdat.nlines <= -complistmax) ||
(!complistmax && listdat.nlines >= lines))) {
(!complistmax && listdat.nlines >= zterm_lines))) {
int qup, l;
zsetterm();
......@@ -1893,7 +1898,7 @@ asklist(void)
listdat.nlist, listdat.nlines) :
fprintf(shout, "zsh: do you wish to see all %d lines? ",
listdat.nlines));
qup = ((l + columns - 1) / columns) - 1;
qup = ((l + zterm_columns - 1) / zterm_columns) - 1;
fflush(shout);
if (!getzlequery()) {
if (clearflag) {
......@@ -1987,7 +1992,7 @@ printlist(int over, CLPrintFunc printm, int showall)
while ((p = *pp++)) {
zputs(p, shout);
if (*pp) {
if (MB_METASTRWIDTH(p) % columns)
if (MB_METASTRWIDTH(p) % zterm_columns)
putc('\n', shout);
else
fputs(" \010", shout);
......@@ -2113,7 +2118,7 @@ printlist(int over, CLPrintFunc printm, int showall)
if (clearflag) {
/* Move the cursor up to the prompt, if always_last_prompt *
* is set and all that... */
if ((ml = listdat.nlines + nlnct - 1) < lines) {
if ((ml = listdat.nlines + nlnct - 1) < zterm_lines) {
tcmultout(TCUP, TCMULTUP, ml);
showinglist = -1;
......@@ -2134,8 +2139,8 @@ bld_all_str(Cmatch all)
{
Cmgroup g;
Cmatch *mp, m;
int len = columns - 5, t, add = 0;
VARARR(char, buf, columns + 1);
int len = zterm_columns - 5, t, add = 0;
VARARR(char, buf, zterm_columns + 1);
buf[0] = '\0';
......
......@@ -226,8 +226,8 @@ cd_prep()
runp = &(cd_state.runs);
if (cd_state.groups) {
int lines = cd_state.groups + cd_state.descs;
VARARR(Cdstr, grps, lines);
int preplines = cd_state.groups + cd_state.descs;
VARARR(Cdstr, grps, preplines);
VARARR(int, wids, cd_state.maxg);
Cdstr gs, gp, gn, *gpp;
int i, j, d;
......@@ -275,7 +275,7 @@ cd_prep()
if (cd_state.gprew > cd_state.maxmlen && cd_state.maxglen > 1)
return 1;
for (i = 0; i < lines; i++) {
for (i = 0; i < preplines; i++) {
Cdstr s = grps[i];
int dummy;
......@@ -283,9 +283,9 @@ cd_prep()
unmetafy(s->sortstr, &dummy);
}
qsort(grps, lines, sizeof(Cdstr), cd_sort);
qsort(grps, preplines, sizeof(Cdstr), cd_sort);
for (i = lines, strp = grps; i > 1; i--, strp++) {
for (i = preplines, strp = grps; i > 1; i--, strp++) {
strp2 = strp + 1;
if (!strcmp((*strp)->desc, (*strp2)->desc))
continue;
......@@ -303,9 +303,9 @@ cd_prep()
expl = (Cdrun) zalloc(sizeof(*run));
expl->type = CRT_EXPL;
expl->strs = grps[0];
expl->count = lines;
expl->count = preplines;
for (i = lines, strp = grps, strp2 = NULL; i; i--, strp++) {
for (i = preplines, strp = grps, strp2 = NULL; i; i--, strp++) {
str = *strp;
*strp = str->other;
if (strp2)
......@@ -321,7 +321,7 @@ cd_prep()
*strp2 = NULL;
for (i = cd_state.maxg - 1; i; i--) {
for (d = 0, j = lines, strp = grps; j; j--, strp++) {
for (d = 0, j = preplines, strp = grps; j; j--, strp++) {
if ((str = *strp)) {
if (d) {
*runp = run = (Cdrun) zalloc(sizeof(*run));
......@@ -465,7 +465,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep,
cd_state.showd = disp;
cd_state.maxg = cd_state.groups = cd_state.descs = 0;
cd_state.maxmlen = atoi(mlen);
itmp = columns - cd_state.swidth - 4;
itmp = zterm_columns - cd_state.swidth - 4;
if (cd_state.maxmlen > itmp)
cd_state.maxmlen = itmp;
if (cd_state.maxmlen < 4)
......@@ -545,7 +545,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep,
args++;
}
if (disp && grp) {
int mg = columns;
int mg = zterm_columns;
do {
cd_group(mg);
......@@ -651,7 +651,8 @@ cd_get(char **params)
* is available. Leave 1 character at the end of screen
* as safety margin
*/
remw = columns - cd_state.premaxw - cd_state.swidth - 3;
remw = zterm_columns - cd_state.premaxw -
cd_state.swidth - 3;
d = str->desc;
w = MB_METASTRWIDTH(d);
if (w <= remw)
......@@ -727,7 +728,8 @@ cd_get(char **params)
case CRT_EXPL:
{
/* add columns as safety margin */
VARARR(char, dbuf, cd_state.suf + cd_state.slen + columns);
VARARR(char, dbuf, cd_state.suf + cd_state.slen +
zterm_columns);
char buf[20], *p, *pp, *d;
int i = run->count, remw, w, l;
......@@ -743,7 +745,8 @@ cd_get(char **params)
}
strcpy(dbuf, cd_state.sep);
remw = columns - cd_state.gprew - cd_state.swidth - CM_SPACE;
remw = zterm_columns - cd_state.gprew -
cd_state.swidth - CM_SPACE;
p = pp = dbuf + cd_state.slen;
d = str->desc;
w = MB_METASTRWIDTH(d);
......
......@@ -688,12 +688,12 @@ resetvideo(void)
{
int ln;
winw = columns; /* terminal width */
winw = zterm_columns; /* terminal width */
if (termflags & TERM_SHORT)
winh = 1;
else
winh = (lines < 2) ? 24 : lines;
rwinh = lines; /* keep the real number of lines */
winh = (zterm_lines < 2) ? 24 : zterm_lines;
rwinh = zterm_lines; /* keep the real number of lines */
vln = vmaxln = winprompt = 0;
winpos = -1;
if (winw_alloc != winw || winh_alloc != winh) {
......@@ -1082,7 +1082,7 @@ zrefresh(void)
cleareol = 0; /* unset */
more_start = more_end = 0; /* unset */
if (isset(SINGLELINEZLE) || lines < 3
if (isset(SINGLELINEZLE) || zterm_lines < 3
|| (termflags & (TERM_NOUP | TERM_BAD | TERM_UNKNOWN)))
termflags |= TERM_SHORT;
else
......@@ -1138,7 +1138,7 @@ zrefresh(void)
}
fflush(shout);
clearf = clearflag;
} else if (winw != columns || rwinh != lines)
} else if (winw != zterm_columns || rwinh != zterm_lines)
resetvideo();
/* now winw equals columns and winh equals lines
......@@ -2004,7 +2004,7 @@ refreshline(int ln)
* last line lest undesired scrolling occurs due to `illegal'
* characters on screen
*/
if (tccan(TCINS) && (vln != lines - 1)) {
if (tccan(TCINS) && (vln != zterm_lines - 1)) {
/* not on last line */
for (i = 1; nl[i].chr; i++) {
if (tcinscost(i) < wpfxlen(ol, nl + i)) {
......
......@@ -2419,13 +2419,13 @@ printfmt(char *fmt, int n, int dopr, int doesc)
if (tccan(TCCLEAREOL))
tcout(TCCLEAREOL);
else {
int s = columns - 1 - (cc % columns);
int s = zterm_columns - 1 - (cc % zterm_columns);
while (s-- > 0)
putc(' ', shout);
}
}
l += 1 + ((cc - 1) / columns);
l += 1 + ((cc - 1) / zterm_columns);
cc = 0;
if (dopr)
putc('\n', shout);
......@@ -2445,18 +2445,18 @@ printfmt(char *fmt, int n, int dopr, int doesc)
} else
p += clen;
cc += WCWIDTH_WINT(cchar);
if (dopr && !(cc % columns))
if (dopr && !(cc % zterm_columns))
fputs(" \010", shout);
}
}
}
if (dopr) {
if (!(cc % columns))
if (!(cc % zterm_columns))
fputs(" \010", shout);
if (tccan(TCCLEAREOL))
tcout(TCCLEAREOL);
else {
int s = columns - 1 - (cc % columns);
int s = zterm_columns - 1 - (cc % zterm_columns);
while (s-- > 0)
putc(' ', shout);
......@@ -2467,7 +2467,7 @@ printfmt(char *fmt, int n, int dopr, int doesc)
* cc is correct, i.e. if just misses wrapping we still add 1.
* (Why?)
*/
return l + (cc / columns);
return l + (cc / zterm_columns);
}
/* This is used to print expansions. */
......@@ -2481,8 +2481,8 @@ listlist(LinkList l)
LinkNode node;
char **p;
VARARR(int, lens, num);
VARARR(int, widths, columns);
int longest = 0, shortest = columns, totl = 0;
VARARR(int, widths, zterm_columns);
int longest = 0, shortest = zterm_columns, totl = 0;
int len, ncols, nlines, tolast, col, i, max, pack = 0, *lenp;
for (node = firstnode(l), p = data; node; incnode(node), p++)
......@@ -2500,7 +2500,7 @@ listlist(LinkList l)
shortest = len;
totl += len;
}
if ((ncols = ((columns + 2) / longest))) {
if ((ncols = ((zterm_columns + 2) / longest))) {
int tlines = 0, tline, tcols = 0, maxlen, nth, width;
nlines = (num + ncols - 1) / ncols;
......@@ -2509,7 +2509,7 @@ listlist(LinkList l)
if (isset(LISTROWSFIRST)) {
int count, tcol, first, maxlines = 0, llines;
for (tcols = columns / shortest; tcols > ncols;
for (tcols = zterm_columns / shortest; tcols > ncols;
tcols--) {
for (nth = first = maxlen = width = maxlines =
llines = tcol = 0,
......@@ -2522,7 +2522,7 @@ listlist(LinkList l)
nth += tcols;
tlines++;
if (nth >= num) {
if ((width += maxlen) >= columns)
if ((width += maxlen) >= zterm_columns)
break;
widths[tcol++] = maxlen;
maxlen = 0;
......@@ -2536,13 +2536,13 @@ listlist(LinkList l)
widths[tcol++] = maxlen;
width += maxlen;
}
if (!count && width < columns)
if (!count && width < zterm_columns)
break;
}
if (tcols > ncols)
tlines = maxlines;
} else {
for (tlines = ((totl + columns) / columns);
for (tlines = ((totl + zterm_columns) / zterm_columns);
tlines < nlines; tlines++) {
for (p = data, nth = tline = width =
maxlen = tcols = 0;
......@@ -2550,7 +2550,7 @@ listlist(LinkList l)
if (lens[nth] > maxlen)
maxlen = lens[nth];
if (++tline == tlines) {
if ((width += maxlen) >= columns)
if ((width += maxlen) >= zterm_columns)
break;
widths[tcols++] = maxlen;
maxlen = tline = 0;
......@@ -2560,7 +2560,7 @@ listlist(LinkList l)
widths[tcols++] = maxlen;
width += maxlen;
}
if (nth == num && width < columns)
if (nth == num && width < zterm_columns)
break;
}
}
......@@ -2572,7 +2572,7 @@ listlist(LinkList l)
} else {
nlines = 0;
for (p = data; *p; p++)
nlines += 1 + (strlen(*p) / columns);
nlines += 1 + (strlen(*p) / zterm_columns);
}
/* Set the cursor below the prompt. */
trashzle();
......@@ -2581,7 +2581,7 @@ listlist(LinkList l)
clearflag = (isset(USEZLE) && !termflags && tolast);
max = getiparam("LISTMAX");
if ((max && num > max) || (!max && nlines > lines)) {
if ((max && num > max) || (!max && nlines > zterm_lines)) {
int qup, l;
zsetterm();
......@@ -2589,7 +2589,7 @@ listlist(LinkList l)
fprintf(shout, "zsh: do you wish to see all %d possibilities (%d lines)? ",
num, nlines) :
fprintf(shout, "zsh: do you wish to see all %d lines? ", nlines));
qup = ((l + columns - 1) / columns) - 1;
qup = ((l + zterm_columns - 1) / zterm_columns) - 1;
fflush(shout);
if (!getzlequery()) {
if (clearflag) {
......@@ -2656,7 +2656,7 @@ listlist(LinkList l)
}
}
if (clearflag) {
if ((nlines += nlnct - 1) < lines) {
if ((nlines += nlnct - 1) < zterm_lines) {
tcmultout(TCUP, TCMULTUP, nlines);
showinglist = -1;
} else
......
......@@ -1257,7 +1257,7 @@ showmsg(char const *msg)
p++;