More than one data field may follow T} on the same input line.
authorschwarze <schwarze@openbsd.org>
Sun, 19 Apr 2015 20:34:56 +0000 (20:34 +0000)
committerschwarze <schwarze@openbsd.org>
Sun, 19 Apr 2015 20:34:56 +0000 (20:34 +0000)
Issue found by Christian Neukirchen <chneukirchen at gmail dot com>
in the socket(2) manual on Linux.
Also fixes major rendering bugs (including partial loss of content)
in XkbChangeControls(3), XkbFreeClientMap(3), XkbGetMap(3),
XkbKeyNumGroups(3), and XkbSetMap(3).

regress/usr.bin/mandoc/tbl/data/block_unclosed.in
regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii
usr.bin/mandoc/tbl_data.c

index c7c9728..5e3526c 100644 (file)
@@ -9,6 +9,11 @@ lll.
 begin:T{
 middle
 T}:end
+T{
+begin
+T}:middle:T{
+end
+T}
 incomplete:T{
 block
 .TE
index d69d972..bf0338c 100644 (file)
@@ -10,6 +10,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
 
        +--------------------------+
        |begin        middle   end |
+       |begin        middle   end |
        |incomplete   block        |
        +--------------------------+
        normal text
index 972868f..4171991 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: tbl_data.c,v 1.26 2015/01/30 17:31:20 schwarze Exp $ */
+/*     $OpenBSD: tbl_data.c,v 1.27 2015/04/19 20:34:56 schwarze Exp $ */
 /*
  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -130,7 +130,8 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos)
                if (p[pos] == tbl->opts.tab) {
                        tbl->part = TBL_PART_DATA;
                        pos++;
-                       getdata(tbl, tbl->last_span, ln, p, &pos);
+                       while (p[pos] != '\0')
+                               getdata(tbl, tbl->last_span, ln, p, &pos);
                        return(1);
                } else if (p[pos] == '\0') {
                        tbl->part = TBL_PART_DATA;