diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-28 17:32:07 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-28 17:32:07 +0000 |
commit | d04af2267985bcac279f3ffad1ce6ee9fec2d44f (patch) | |
tree | 416a18e84777806b55f50c7fb1147e9c88c4ef4b /tbl_data.c | |
parent | b8a3bef0831e00e2921ed5feb59338efcca0984d (diff) | |
download | mandoc-d04af2267985bcac279f3ffad1ce6ee9fec2d44f.tar.gz |
* Polish tbl(7) error reporting.
* Do not print out macro names in tbl(7) data blocks.
* Like with GNU tbl, let empty tables cause a blank line.
* Avoid producing empty tables in -Tman.
Diffstat (limited to 'tbl_data.c')
-rw-r--r-- | tbl_data.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -64,8 +64,8 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp, */ if (NULL == cp) { - mandoc_msg(MANDOCERR_TBLEXTRADAT, tbl->parse, - ln, *pos, NULL); + mandoc_msg(MANDOCERR_TBLDATA_EXTRA, tbl->parse, + ln, *pos, p + *pos); /* Skip to the end... */ while (p[*pos]) (*pos)++; @@ -131,8 +131,8 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp, TBL_CELL_DHORIZ == dat->layout->pos || TBL_CELL_DOWN == dat->layout->pos) if (TBL_DATA_DATA == dat->pos && '\0' != *dat->string) - mandoc_msg(MANDOCERR_TBLIGNDATA, - tbl->parse, ln, sv, NULL); + mandoc_msg(MANDOCERR_TBLDATA_SPAN, + tbl->parse, ln, sv, dat->string); return; } @@ -163,16 +163,16 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos) dat->pos = TBL_DATA_DATA; if (dat->string) { - sz = strlen(p) + strlen(dat->string) + 2; + sz = strlen(p + pos) + strlen(dat->string) + 2; dat->string = mandoc_realloc(dat->string, sz); (void)strlcat(dat->string, " ", sz); - (void)strlcat(dat->string, p, sz); + (void)strlcat(dat->string, p + pos, sz); } else - dat->string = mandoc_strdup(p); + dat->string = mandoc_strdup(p + pos); if (TBL_CELL_DOWN == dat->layout->pos) - mandoc_msg(MANDOCERR_TBLIGNDATA, tbl->parse, - ln, pos, NULL); + mandoc_msg(MANDOCERR_TBLDATA_SPAN, tbl->parse, + ln, pos, dat->string); return(0); } |