diff options
-rw-r--r-- | usr.bin/mandoc/main.c | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/man.c | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_term.c | 8 |
6 files changed, 20 insertions, 18 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index 8a219d31d45..1c620192b62 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.48 2010/09/27 21:25:28 schwarze Exp $ */ +/* $Id: main.c,v 1.49 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -160,6 +160,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "line argument(s) will be lost", "body argument(s) will be lost", "paragraph macro ignored", + "tbl(1) error", "generic fatal error", diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index f981ae68d5d..9f43b074228 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.42 2010/10/15 21:33:47 schwarze Exp $ */ +/* $Id: man.c,v 1.43 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -135,8 +135,10 @@ man_parseln(struct man *m, int ln, char *buf, int offs) if (n && MAN_TS == n->tok && MAN_BODY == n->type && strncmp(buf+offs, ".TE", 3)) { n = n->parent; - return(tbl_read(n->data.TS, "<man>", ln, buf+offs, - strlen(buf+offs)) ? 1 : 0); + if ( ! tbl_read(n->data.TS, "man tbl parser", + ln, buf+offs, strlen(buf+offs))) + man_nmsg(m, n, MANDOCERR_TBL); + return(1); } return(('.' == buf[offs] || '\'' == buf[offs]) ? diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 2e59ae68264..4f8a3623957 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.49 2010/10/15 22:07:12 schwarze Exp $ */ +/* $Id: man_term.c,v 1.50 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -838,10 +838,8 @@ pre_TS(DECL_ARGS) if (MAN_BLOCK != n->type) return(0); - if ( ! tbl_close(p, n->data.TS, "<man>", n->line)) - return(0); - - tbl_write(p, n->data.TS); + if (tbl_close(p, n->data.TS, "man tbl postprocess", n->line)) + tbl_write(p, n->data.TS); return(0); } diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 79835c52e62..db0bc1beedd 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.14 2010/09/27 21:25:28 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.15 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -100,6 +100,7 @@ enum mandocerr { MANDOCERR_ARGSLOST, /* line argument(s) will be lost */ MANDOCERR_BODYLOST, /* body argument(s) will be lost */ MANDOCERR_IGNPAR, /* paragraph macro ignored */ + MANDOCERR_TBL, /* tbl(1) error */ MANDOCERR_FATAL, /* ===== end of fatal errors ===== */ diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index f9d44990df8..f1afacbc93a 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.67 2010/10/16 13:38:29 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.68 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -241,8 +241,10 @@ mdoc_parseln(struct mdoc *m, int ln, char *buf, int offs) if (n && MDOC_TS == n->tok && MDOC_BODY == n->type && strncmp(buf+offs, ".TE", 3)) { n = n->parent; - return(tbl_read(n->data.TS, "<mdoc>", ln, buf+offs, - strlen(buf+offs)) ? 1 : 0); + if ( ! tbl_read(n->data.TS, "mdoc tbl parser", + ln, buf+offs, strlen(buf+offs))) + mdoc_nmsg(m, n, MANDOCERR_TBL); + return(1); } /* diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index 4851fb6693c..86c325cd5e2 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.110 2010/10/16 13:38:29 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.111 2010/10/16 20:49:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -2100,10 +2100,8 @@ termp_ts_pre(DECL_ARGS) if (MDOC_BLOCK != n->type) return(0); - if ( ! tbl_close(p, n->data.TS, "<mdoc>", n->line)) - return(0); - - tbl_write(p, n->data.TS); + if (tbl_close(p, n->data.TS, "mdoc tbl postprocess", n->line)) + tbl_write(p, n->data.TS); return(0); } |