diff options
| author | wkj <devnull@localhost> | 2004-05-17 02:23:43 +0000 |
|---|---|---|
| committer | wkj <devnull@localhost> | 2004-05-17 02:23:43 +0000 |
| commit | 8a3cbc157981485adc947c0477dc3e4907acc9a3 (patch) | |
| tree | 349384ec94a177152ef945dcf41b9d368de5bf18 /src/cmd/tbl/te.c | |
| parent | 1f72bc47fe416f8fa00d8cea27ee1482fba28c20 (diff) | |
| download | plan9port-8a3cbc157981485adc947c0477dc3e4907acc9a3.tar.gz plan9port-8a3cbc157981485adc947c0477dc3e4907acc9a3.zip | |
Make tbl compile silently.
Diffstat (limited to 'src/cmd/tbl/te.c')
| -rw-r--r-- | src/cmd/tbl/te.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cmd/tbl/te.c b/src/cmd/tbl/te.c index e6282994..3df8d445 100644 --- a/src/cmd/tbl/te.c +++ b/src/cmd/tbl/te.c @@ -4,9 +4,9 @@ void error(char *s) { - fprintf(stderr, "\n%s:%d: %s\n", ifile, iline, s); - fprintf(stderr, "tbl quits\n"); - exit(1); + fprint(2, "\n%s:%d: %s\n", ifile, iline, s); + fprint(2, "tbl quits\n"); + exits(s); } @@ -18,14 +18,13 @@ gets1(char *s, int size) iline++; ns = s; - p = fgetln(tabin, &nbl); + p = Brdline(tabin, '\n'); while (p == 0) { if (swapin() == 0) return(0); - p = fgetln(tabin, &nbl); + p = Brdline(tabin, '\n'); } - if(p != 0 && p[nbl-1] == '\n') - nbl--; + nbl = Blinelen(tabin)-1; if(nbl >= size) error("input buffer too small"); p[nbl] = 0; @@ -62,11 +61,11 @@ get1char(void) if (backp > backup) c = *--backp; else - c = fgetc(tabin); + c = Bgetc(tabin); if (c == 0) /* EOF */ { if (swapin() == 0) error("unexpected EOF"); - c = fgetc(tabin); + c = Bgetc(tabin); } if (c == '\n') iline++; |
