version 1.12, 2007/03/20 03:50:39 |
version 1.13, 2007/05/01 01:26:23 |
|
|
FILE *fp; |
FILE *fp; |
int ch, tflag, xflag; |
int ch, tflag, xflag; |
char *p; |
char *p; |
|
const char *errstr; |
|
|
if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) { |
if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) { |
if ((p = getenv("COLUMNS"))) |
if ((p = getenv("COLUMNS")) && *p != '\0') { |
termwidth = atoi(p); |
termwidth = strtonum(p, 1, INT_MAX, &errstr); |
|
if (errstr != NULL) |
|
errx(1, "%s: %s", errstr, p); |
|
} |
} else |
} else |
termwidth = win.ws_col; |
termwidth = win.ws_col; |
|
|
|
|
while ((ch = getopt(argc, argv, "c:s:tx")) != -1) |
while ((ch = getopt(argc, argv, "c:s:tx")) != -1) |
switch(ch) { |
switch(ch) { |
case 'c': |
case 'c': |
termwidth = atoi(optarg); |
termwidth = strtonum(optarg, 1, INT_MAX, &errstr); |
|
if (errstr != NULL) |
|
errx(1, "%s: %s", errstr, optarg); |
break; |
break; |
case 's': |
case 's': |
separator = optarg; |
separator = optarg; |