version 1.22, 2015/04/13 05:11:23 |
version 1.23, 2015/04/18 18:28:37 |
|
|
static int termwidth = -1; |
static int termwidth = -1; |
|
|
if (termwidth == -1) { |
if (termwidth == -1) { |
|
termwidth = 0; |
if ((p = getenv("COLUMNS"))) |
if ((p = getenv("COLUMNS"))) |
termwidth = atoi(p); |
termwidth = strtonum(p, 0, INT_MAX, NULL); |
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
if (termwidth == 0 && |
|
ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
win.ws_col > 0) |
win.ws_col > 0) |
termwidth = win.ws_col; |
termwidth = win.ws_col; |
else |
if (termwidth == 0) |
termwidth = 60; |
termwidth = 60; |
} |
} |
|
|