summaryrefslogtreecommitdiffstats
path: root/src/cmd/tbl/tg.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-04-20 21:00:21 +0000
committerrsc <devnull@localhost>2006-04-20 21:00:21 +0000
commita5f3a00bcd0452d78afc5d8064da611d4b448093 (patch)
treef037f35d470d699c90cbf78888620a9155d7cfbd /src/cmd/tbl/tg.c
parent71e936d7166b088aa3e2ec55d14b53cb2a3ac5ec (diff)
downloadplan9port-a5f3a00bcd0452d78afc5d8064da611d4b448093.tar.gz
plan9port-a5f3a00bcd0452d78afc5d8064da611d4b448093.zip
64-bit safe
Diffstat (limited to 'src/cmd/tbl/tg.c')
-rw-r--r--src/cmd/tbl/tg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/tbl/tg.c b/src/cmd/tbl/tg.c
index 6abb1490..3afc88c6 100644
--- a/src/cmd/tbl/tg.c
+++ b/src/cmd/tbl/tg.c
@@ -6,9 +6,10 @@ gettext(char *sp, int ilin, int icol, char *fn, char *sz)
{
/* get a section of text */
char line[4096];
- int oname;
+ int oname, startline;
char *vs;
+ startline = iline;
if (texname == 0)
error("Too many text block diversions");
if (textflg == 0) {
@@ -42,7 +43,11 @@ gettext(char *sp, int ilin, int icol, char *fn, char *sz)
if (ctype(ilin, icol) == 'a')
Bprint(&tabout, ".ll -2n\n");
Bprint(&tabout, ".in 0\n");
- while (gets1(line, sizeof(line))) {
+ for (;;) {
+ if (gets1(line, sizeof(line)) == nil) {
+ iline = startline;
+ error("missing closing T}");
+ }
if (line[0] == 'T' && line[1] == '}' && line[2] == tab)
break;
if (match("T}", line))