fix #if handling in get_term_columns

This commit is contained in:
Mike Frysinger 2007-04-17 12:21:15 +00:00
parent e635e16464
commit f5e65274f0

View File

@ -162,13 +162,13 @@ static bool colour_terminal (void)
static int get_term_columns (void)
{
#ifdef TIOCGSIZE /* BSD */
#if defined(TIOCGSIZE) /* BSD */
struct ttysize ts;
if (ioctl(0, TIOCGSIZE, &ts) == 0)
return (ts.ts_cols);
#elif TIOCGWINSZ /* Linux */
struct winsize ws;
#elif defined(TIOCGWINSZ) /* Linux */
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) == 0)
return (ws.ws_col);