version 1.2, 1996/06/26 05:39:08 |
version 1.3, 1997/09/11 11:21:07 |
|
|
*/ |
*/ |
if ((f = fopen(appends[i].s, "r")) == NULL) |
if ((f = fopen(appends[i].s, "r")) == NULL) |
break; |
break; |
while (count = fread(buf, sizeof(char), sizeof(buf), f)) |
while ((count = fread(buf, sizeof(char), sizeof(buf), f))) |
(void)fwrite(buf, sizeof(char), count, stdout); |
(void)fwrite(buf, sizeof(char), count, stdout); |
(void)fclose(f); |
(void)fclose(f); |
break; |
break; |
|
|
static int termwidth = -1; |
static int termwidth = -1; |
|
|
if (termwidth == -1) |
if (termwidth == -1) |
if (p = getenv("COLUMNS")) |
if ((p = getenv("COLUMNS"))) |
termwidth = atoi(p); |
termwidth = atoi(p); |
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && |
win.ws_col > 0) |
win.ws_col > 0) |
|
|
} else { |
} else { |
escapes = "\\\a\b\f\n\r\t\v"; |
escapes = "\\\a\b\f\n\r\t\v"; |
(void)putchar('\\'); |
(void)putchar('\\'); |
if (p = strchr(escapes, *s)) { |
if ((p = strchr(escapes, *s))) { |
(void)putchar("\\abfnrtv"[p - escapes]); |
(void)putchar("\\abfnrtv"[p - escapes]); |
count += 2; |
count += 2; |
} else { |
} else { |