version 1.36, 2015/12/09 19:39:10 |
version 1.37, 2016/03/17 05:27:10 |
|
|
if (hflag + iflag + uflag > 1) |
if (hflag + iflag + uflag > 1) |
usage(); |
usage(); |
|
|
if (isatty(STDOUT_FILENO)) { |
termwidth = 0; |
if ((cp = getenv("COLUMNS")) != NULL && *cp != '\0') { |
if ((cp = getenv("COLUMNS")) != NULL) |
termwidth = strtol(cp, &ep, 10); |
termwidth = strtonum(cp, 1, LONG_MAX, NULL); |
if (*ep != '\0' || termwidth >= INT_MAX || |
if (termwidth == 0 && ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
termwidth < 0) |
win.ws_col > 0) |
termwidth = 0; |
termwidth = win.ws_col; |
} |
if (termwidth == 0) |
if (termwidth == 0 && |
|
ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
|
win.ws_col > 0) |
|
termwidth = win.ws_col; |
|
else |
|
termwidth = 80; |
|
} else |
|
termwidth = 80; |
termwidth = 80; |
|
|
setvbuf(stdout, NULL, _IOLBF, 0); |
setvbuf(stdout, NULL, _IOLBF, 0); |
|
|
if (argc == optind) { |
if (argc == optind) { |