Whoops! VTYs return zero values for TIOCGSIZE! Work around this.

This commit is contained in:
Jordan K. Hubbard 1996-08-01 13:47:03 +00:00
parent a0779fbe20
commit fa05dcb5ee
3 changed files with 6 additions and 6 deletions

View File

@ -82,8 +82,8 @@ set_termcap(void)
}
if (ioctl(0, TIOCGSIZE, &ts) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
ts.ts_lines = OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE;
ts.ts_lines = 0;
}
StatusLine = ts.ts_lines;
StatusLine = ts.ts_lines ? ts.ts_lines : (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}

View File

@ -82,8 +82,8 @@ set_termcap(void)
}
if (ioctl(0, TIOCGSIZE, &ts) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
ts.ts_lines = OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE;
ts.ts_lines = 0;
}
StatusLine = ts.ts_lines;
StatusLine = ts.ts_lines ? ts.ts_lines : (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}

View File

@ -82,8 +82,8 @@ set_termcap(void)
}
if (ioctl(0, TIOCGSIZE, &ts) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
ts.ts_lines = OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE;
ts.ts_lines = 0;
}
StatusLine = ts.ts_lines;
StatusLine = ts.ts_lines ? ts.ts_lines : (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}