|
|
1.1 root 1: #include <stdio.h>
2: #include <ctype.h>
3:
4: #define bool char
5: #define TRUE 1
6: #define FALSE 0
7:
8: extern char buffer[];
9:
10:
11: /*
12: * get_termcap:
13: * read next termcap entry into buffer from standard input.
14: */
15: get_termcap ()
16: {
17: int c;
18: char *bptr;
19:
20: bptr = buffer;
21: while ((c = getchar ()) != '\n') {
22: if (c == '\\') {
23: if ((c = getchar ()) != '\n') {
24: if (ungetc (c, stdin) == EOF) {
25: fprintf (stderr, "ungetc failed.\n");
26: exit (1);
27: }
28: *(bptr++) = '\\';
29: }
30: }
31: else {
32: *(bptr++) = c;
33: }
34: }
35: *bptr = '\0';
36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.