summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-01-28 17:30:37 +0000
committerschwarze <schwarze@openbsd.org>2015-01-28 17:30:37 +0000
commit92ff8da656b8b1e12dee549d9dd02aec127bdcb1 (patch)
tree88a2fa4f92806a2b4122e1394c92e0cd851a9a18
parentRemove ssl_by_mem_ctrl() and x509_mem_lookup to unbreak the build. It (diff)
downloadwireguard-openbsd-92ff8da656b8b1e12dee549d9dd02aec127bdcb1.tar.xz
wireguard-openbsd-92ff8da656b8b1e12dee549d9dd02aec127bdcb1.zip
* 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.
-rw-r--r--regress/usr.bin/mandoc/tbl/Makefile13
-rw-r--r--regress/usr.bin/mandoc/tbl/block_unclosed.in28
-rw-r--r--regress/usr.bin/mandoc/tbl/block_unclosed.out_ascii25
-rw-r--r--regress/usr.bin/mandoc/tbl/block_unclosed.out_lint2
-rw-r--r--regress/usr.bin/mandoc/tbl/empty.in9
-rw-r--r--regress/usr.bin/mandoc/tbl/empty.out_ascii15
-rw-r--r--regress/usr.bin/mandoc/tbl/empty.out_lint1
-rw-r--r--regress/usr.bin/mandoc/tbl/layout.out_lint4
-rw-r--r--regress/usr.bin/mandoc/tbl/macro.in6
-rw-r--r--regress/usr.bin/mandoc/tbl/macro.out_lint3
-rw-r--r--regress/usr.bin/mandoc/tbl/opt.out_lint2
-rw-r--r--usr.bin/mandoc/libroff.h4
-rw-r--r--usr.bin/mandoc/mandoc.h16
-rw-r--r--usr.bin/mandoc/mdoc_man.c15
-rw-r--r--usr.bin/mandoc/read.c12
-rw-r--r--usr.bin/mandoc/roff.c11
-rw-r--r--usr.bin/mandoc/tbl.c30
-rw-r--r--usr.bin/mandoc/tbl_data.c20
-rw-r--r--usr.bin/mandoc/tbl_opts.c5
19 files changed, 157 insertions, 64 deletions
diff --git a/regress/usr.bin/mandoc/tbl/Makefile b/regress/usr.bin/mandoc/tbl/Makefile
index af6f4361f88..55f910d4738 100644
--- a/regress/usr.bin/mandoc/tbl/Makefile
+++ b/regress/usr.bin/mandoc/tbl/Makefile
@@ -1,10 +1,13 @@
-# $OpenBSD: Makefile,v 1.11 2015/01/28 04:18:31 schwarze Exp $
+# $OpenBSD: Makefile,v 1.12 2015/01/28 17:30:37 schwarze Exp $
-REGRESS_TARGETS = blankline center expand fonts layout layout_center
+REGRESS_TARGETS = blankline block_unclosed center
+REGRESS_TARGETS += empty expand fonts layout layout_center
REGRESS_TARGETS += macro misalign nested numbers opt span vert
-LINT_TARGETS = layout macro nested opt
+LINT_TARGETS = block_unclosed empty layout macro nested opt
-# groff-1.22.3 defect:
+# groff-1.22.3 defects:
+# - When a table ends in the middle of a block,
+# GNU eqn produces no output whatsoever for the whole table.
# - When space is insufficient (on either side) for properly aligning
# a number, GNU tbl(1) moves the number too much to the right,
# overflowing the column, even if space would be sufficient without
@@ -13,7 +16,7 @@ LINT_TARGETS = layout macro nested opt
# trivial difference to groff-1.22.3:
# .TS in a table causes a blank table line in GNU tbl(1), but not in mandoc.
-SKIP_GROFF = misalign nested
+SKIP_GROFF = block_unclosed misalign nested
SKIP_TMAN ?= ALL SILENT
TBL = /usr/local/bin/tbl
diff --git a/regress/usr.bin/mandoc/tbl/block_unclosed.in b/regress/usr.bin/mandoc/tbl/block_unclosed.in
new file mode 100644
index 00000000000..9d535a64a8d
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/block_unclosed.in
@@ -0,0 +1,28 @@
+.TH TBL-BLOCK_UNCLOSED 1 "January 28, 2015" OpenBSD
+.SH NAME
+tbl-block_unclosed \- unclosed text block
+.SH DESCRIPTION
+normal text
+.TS
+box tab(:);
+lll.
+begin:T{
+middle
+T}:end
+incomplete:T{
+block
+.TE
+normal text
+.TS
+box tab(:);
+lll.
+begin:T{
+middle
+T}:end
+incomplete:T{
+block
+.T&
+rrr.
+reset:still:works
+.TE
+normal text
diff --git a/regress/usr.bin/mandoc/tbl/block_unclosed.out_ascii b/regress/usr.bin/mandoc/tbl/block_unclosed.out_ascii
new file mode 100644
index 00000000000..d0ac26b8fa6
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/block_unclosed.out_ascii
@@ -0,0 +1,25 @@
+TBL-BLOCK_UNCLOSED(1) General Commands Manual TBL-BLOCK_UNCLOSED(1)
+
+
+
+NNAAMMEE
+ tbl-block_unclosed - unclosed text block
+
+DDEESSCCRRIIPPTTIIOONN
+ normal text
+
+ +--------------------------+
+ |begin middle end |
+ |incomplete block |
+ +--------------------------+
+ normal text
+
+ +----------------------------+
+ |begin middle end |
+ |incomplete block |
+ | reset still works |
+ +----------------------------+
+ normal text
+
+
+OpenBSD January 28, 2015 TBL-BLOCK_UNCLOSED(1)
diff --git a/regress/usr.bin/mandoc/tbl/block_unclosed.out_lint b/regress/usr.bin/mandoc/tbl/block_unclosed.out_lint
new file mode 100644
index 00000000000..452cde4d05c
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/block_unclosed.out_lint
@@ -0,0 +1,2 @@
+mandoc: block_unclosed.in:6:1: ERROR: data block open at end of tbl: TE
+mandoc: block_unclosed.in: ERROR: data block open at end of tbl: T&
diff --git a/regress/usr.bin/mandoc/tbl/empty.in b/regress/usr.bin/mandoc/tbl/empty.in
new file mode 100644
index 00000000000..0a9a040ec3e
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/empty.in
@@ -0,0 +1,9 @@
+.TH TBL-EMPTY 1 "January 28, 2015" OpenBSD
+.SH NAME
+tbl-empty \- empty table
+.SH DESCRIPTION
+normal text
+.TS
+box; l.
+.TE
+normal text
diff --git a/regress/usr.bin/mandoc/tbl/empty.out_ascii b/regress/usr.bin/mandoc/tbl/empty.out_ascii
new file mode 100644
index 00000000000..5ffe70b2c19
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/empty.out_ascii
@@ -0,0 +1,15 @@
+TBL-EMPTY(1) General Commands Manual TBL-EMPTY(1)
+
+
+
+NNAAMMEE
+ tbl-empty - empty table
+
+DDEESSCCRRIIPPTTIIOONN
+ normal text
+
+ normal text
+
+
+
+OpenBSD January 28, 2015 TBL-EMPTY(1)
diff --git a/regress/usr.bin/mandoc/tbl/empty.out_lint b/regress/usr.bin/mandoc/tbl/empty.out_lint
new file mode 100644
index 00000000000..153902d0c53
--- /dev/null
+++ b/regress/usr.bin/mandoc/tbl/empty.out_lint
@@ -0,0 +1 @@
+mandoc: empty.in:6:1: ERROR: tbl without any data cells
diff --git a/regress/usr.bin/mandoc/tbl/layout.out_lint b/regress/usr.bin/mandoc/tbl/layout.out_lint
index 855c2c26968..6f8587cea50 100644
--- a/regress/usr.bin/mandoc/tbl/layout.out_lint
+++ b/regress/usr.bin/mandoc/tbl/layout.out_lint
@@ -1,5 +1,5 @@
mandoc: layout.in:8:14: WARNING: skipping vertical bar in tbl layout
mandoc: layout.in:8:28: WARNING: skipping vertical bar in tbl layout
-mandoc: layout.in:10:7: ERROR: ignore data in cell
+mandoc: layout.in:10:7: ERROR: ignoring data in spanned tbl cell: h
mandoc: layout.in:16:3: WARNING: tbl column starts with span
-mandoc: layout.in:18:3: ERROR: ignore data in cell
+mandoc: layout.in:18:3: ERROR: ignoring data in spanned tbl cell: b
diff --git a/regress/usr.bin/mandoc/tbl/macro.in b/regress/usr.bin/mandoc/tbl/macro.in
index 07ba2456ea3..f941ab93528 100644
--- a/regress/usr.bin/mandoc/tbl/macro.in
+++ b/regress/usr.bin/mandoc/tbl/macro.in
@@ -6,9 +6,11 @@ normal text
.TS
box tab(:);
l | l .
-a:b
+a:b:stray
_
-.R c:d
+c:T{
+.SM d
+T}
.TE
.PP
normal text
diff --git a/regress/usr.bin/mandoc/tbl/macro.out_lint b/regress/usr.bin/mandoc/tbl/macro.out_lint
index b2c7a8b3023..992369f9a1b 100644
--- a/regress/usr.bin/mandoc/tbl/macro.out_lint
+++ b/regress/usr.bin/mandoc/tbl/macro.out_lint
@@ -1 +1,2 @@
-mandoc: macro.in:11:2: UNSUPP: ignoring macro in table: R c:d
+mandoc: macro.in:9:5: ERROR: ignoring extra tbl data cells: stray
+mandoc: macro.in:12:2: UNSUPP: ignoring macro in table: SM d
diff --git a/regress/usr.bin/mandoc/tbl/opt.out_lint b/regress/usr.bin/mandoc/tbl/opt.out_lint
index 1f217d0b82e..1802b2fd78a 100644
--- a/regress/usr.bin/mandoc/tbl/opt.out_lint
+++ b/regress/usr.bin/mandoc/tbl/opt.out_lint
@@ -2,4 +2,4 @@ mandoc: opt.in:7:5: ERROR: missing tbl option argument: tab
mandoc: opt.in:7:19: ERROR: wrong tbl option argument size: decimalpoint want 1 have 2
mandoc: opt.in:7:23: ERROR: non-alphabetic character in tbl options: %
mandoc: opt.in:7:24: ERROR: skipping unknown tbl option: foo
-mandoc: opt.in:15:21: UNSUPP: eqn in tbl
+mandoc: opt.in:15:21: UNSUPP: eqn delim option in tbl: $$
diff --git a/usr.bin/mandoc/libroff.h b/usr.bin/mandoc/libroff.h
index f9b3896e36f..4041dafba54 100644
--- a/usr.bin/mandoc/libroff.h
+++ b/usr.bin/mandoc/libroff.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libroff.h,v 1.14 2015/01/28 15:02:25 schwarze Exp $ */
+/* $OpenBSD: libroff.h,v 1.15 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -74,7 +74,7 @@ void tbl_layout(struct tbl_node *, int, const char *, int);
void tbl_data(struct tbl_node *, int, const char *, int);
int tbl_cdata(struct tbl_node *, int, const char *, int);
const struct tbl_span *tbl_span(struct tbl_node *);
-void tbl_end(struct tbl_node **);
+int tbl_end(struct tbl_node **);
struct eqn_node *eqn_alloc(int, int, struct mparse *);
enum rofferr eqn_end(struct eqn_node **);
void eqn_free(struct eqn_node *);
diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h
index 06b25f0e480..8e68d821236 100644
--- a/usr.bin/mandoc/mandoc.h
+++ b/usr.bin/mandoc/mandoc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mandoc.h,v 1.132 2015/01/27 05:20:30 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.133 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -143,15 +143,15 @@ enum mandocerr {
/* related to tables */
MANDOCERR_TBLOPT_ALPHA, /* non-alphabetic character in tbl options */
MANDOCERR_TBLOPT_BAD, /* skipping unknown tbl option: option */
- MANDOCERR_TBLOPT_NOARG, /* missing tbl option argument */
- MANDOCERR_TBLOPT_ARGSZ, /* wrong tbl option argument size */
+ MANDOCERR_TBLOPT_NOARG, /* missing tbl option argument: option */
+ MANDOCERR_TBLOPT_ARGSZ, /* wrong tbl option argument size: option */
MANDOCERR_TBLLAYOUT_NONE, /* empty tbl layout */
MANDOCERR_TBLLAYOUT_CHAR, /* invalid character in tbl layout: char */
MANDOCERR_TBLLAYOUT_PAR, /* unmatched parenthesis in tbl layout */
- MANDOCERR_TBLNODATA, /* no table data cells specified */
- MANDOCERR_TBLIGNDATA, /* ignore data in cell */
- MANDOCERR_TBLBLOCK, /* data block still open */
- MANDOCERR_TBLEXTRADAT, /* ignoring extra data cells */
+ MANDOCERR_TBLDATA_NONE, /* tbl without any data cells */
+ MANDOCERR_TBLDATA_SPAN, /* ignoring data in spanned tbl cell: data */
+ MANDOCERR_TBLDATA_EXTRA, /* ignoring extra tbl data cells: data */
+ MANDOCERR_TBLDATA_BLK, /* data block open at end of tbl: macro */
/* related to document structure and macros */
MANDOCERR_FILE, /* cannot open file */
@@ -186,9 +186,9 @@ enum mandocerr {
MANDOCERR_TOOLARGE, /* input too large */
MANDOCERR_CHAR_UNSUPP, /* unsupported control character: number */
MANDOCERR_REQ_UNSUPP, /* unsupported roff request: request */
+ MANDOCERR_TBLOPT_EQN, /* eqn delim option in tbl: arg */
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */
- MANDOCERR_TBLEQN, /* eqn in tbl */
MANDOCERR_MAX
};
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c
index 2c6c966efe0..869df056843 100644
--- a/usr.bin/mandoc/mdoc_man.c
+++ b/usr.bin/mandoc/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_man.c,v 1.80 2015/01/23 14:19:52 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.81 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -1004,10 +1004,12 @@ pre_bl(DECL_ARGS)
return(1);
}
- print_line(".TS", MMAN_nl);
- for (icol = 0; icol < n->norm->Bl.ncols; icol++)
- print_word("l");
- print_word(".");
+ if (n->nchild) {
+ print_line(".TS", MMAN_nl);
+ for (icol = 0; icol < n->norm->Bl.ncols; icol++)
+ print_word("l");
+ print_word(".");
+ }
outflags |= MMAN_nl;
return(1);
}
@@ -1018,7 +1020,8 @@ post_bl(DECL_ARGS)
switch (n->norm->Bl.type) {
case LIST_column:
- print_line(".TE", 0);
+ if (n->nchild)
+ print_line(".TE", 0);
break;
case LIST_enum:
n->norm->Bl.count = 0;
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c
index 18e25e9e87c..efe7b8784bc 100644
--- a/usr.bin/mandoc/read.c
+++ b/usr.bin/mandoc/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.93 2015/01/26 18:41:45 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.94 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -187,10 +187,10 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"empty tbl layout",
"invalid character in tbl layout",
"unmatched parenthesis in tbl layout",
- "no table data cells specified",
- "ignore data in cell",
- "data block still open",
- "ignoring extra data cells",
+ "tbl without any data cells",
+ "ignoring data in spanned tbl cell",
+ "ignoring extra tbl data cells",
+ "data block open at end of tbl",
/* related to document structure and macros */
NULL,
@@ -224,9 +224,9 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"input too large",
"unsupported control character",
"unsupported roff request",
+ "eqn delim option in tbl",
"unsupported tbl layout modifier",
"ignoring macro in table",
- "eqn in tbl",
};
static const char * const mandoclevels[MANDOCLEVEL_MAX] = {
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index 53cb633b4e0..e23b73a6a1b 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.129 2015/01/28 15:02:25 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.130 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -2374,9 +2374,12 @@ roff_TE(ROFF_ARGS)
if (NULL == r->tbl)
mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse,
ln, ppos, "TE");
- else
- tbl_end(&r->tbl);
-
+ else if ( ! tbl_end(&r->tbl)) {
+ free(buf->buf);
+ buf->buf = mandoc_strdup(".sp");
+ buf->sz = 4;
+ return(ROFF_REPARSE);
+ }
return(ROFF_IGN);
}
diff --git a/usr.bin/mandoc/tbl.c b/usr.bin/mandoc/tbl.c
index 93827c8a529..8abee886e5f 100644
--- a/usr.bin/mandoc/tbl.c
+++ b/usr.bin/mandoc/tbl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl.c,v 1.16 2015/01/28 15:02:25 schwarze Exp $ */
+/* $OpenBSD: tbl.c,v 1.17 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -141,17 +141,13 @@ tbl_free(struct tbl_node *tbl)
void
tbl_restart(int line, int pos, struct tbl_node *tbl)
{
- if (TBL_PART_CDATA == tbl->part)
- mandoc_msg(MANDOCERR_TBLBLOCK, tbl->parse,
- tbl->line, tbl->pos, NULL);
+ if (tbl->part == TBL_PART_CDATA)
+ mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->parse,
+ line, pos, "T&");
tbl->part = TBL_PART_LAYOUT;
tbl->line = line;
tbl->pos = pos;
-
- if (NULL == tbl->first_span || NULL == tbl->first_span->first)
- mandoc_msg(MANDOCERR_TBLNODATA, tbl->parse,
- tbl->line, tbl->pos, NULL);
}
const struct tbl_span *
@@ -167,7 +163,7 @@ tbl_span(struct tbl_node *tbl)
return(span);
}
-void
+int
tbl_end(struct tbl_node **tblp)
{
struct tbl_node *tbl;
@@ -176,17 +172,21 @@ tbl_end(struct tbl_node **tblp)
tbl = *tblp;
*tblp = NULL;
+ if (tbl->part == TBL_PART_CDATA)
+ mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->parse,
+ tbl->line, tbl->pos, "TE");
+
sp = tbl->first_span;
while (sp != NULL && sp->first == NULL)
sp = sp->next;
- if (sp == NULL)
- mandoc_msg(MANDOCERR_TBLNODATA, tbl->parse,
+ if (sp == NULL) {
+ mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->parse,
tbl->line, tbl->pos, NULL);
+ return(0);
+ }
- if (tbl->last_span)
+ if (tbl->last_span != NULL)
tbl->last_span->flags |= TBL_SPAN_LAST;
- if (TBL_PART_CDATA == tbl->part)
- mandoc_msg(MANDOCERR_TBLBLOCK, tbl->parse,
- tbl->line, tbl->pos, NULL);
+ return(1);
}
diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c
index 463688c2ee0..b4d7f33ed75 100644
--- a/usr.bin/mandoc/tbl_data.c
+++ b/usr.bin/mandoc/tbl_data.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_data.c,v 1.22 2015/01/28 15:02:25 schwarze Exp $ */
+/* $OpenBSD: tbl_data.c,v 1.23 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -62,8 +62,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)++;
@@ -129,8 +129,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;
}
@@ -161,16 +161,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);
}
diff --git a/usr.bin/mandoc/tbl_opts.c b/usr.bin/mandoc/tbl_opts.c
index 11b6592e66d..2a47162fe26 100644
--- a/usr.bin/mandoc/tbl_opts.c
+++ b/usr.bin/mandoc/tbl_opts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_opts.c,v 1.11 2015/01/28 15:02:25 schwarze Exp $ */
+/* $OpenBSD: tbl_opts.c,v 1.12 2015/01/28 17:30:37 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -78,7 +78,8 @@ arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key)
switch (key) {
case KEY_DELIM:
- mandoc_msg(MANDOCERR_TBLEQN, tbl->parse, ln, *pos, NULL);
+ mandoc_vmsg(MANDOCERR_TBLOPT_EQN, tbl->parse,
+ ln, *pos, "%.*s", len, p + *pos);
want = 2;
break;
case KEY_TAB: