From 3569c652953cc3f9398ed89d4d34873aba09d94c Mon Sep 17 00:00:00 2001 From: schwarze Date: Sun, 19 Apr 2015 20:34:56 +0000 Subject: [PATCH] More than one data field may follow T} on the same input line. Issue found by Christian Neukirchen 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 | 5 +++++ regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii | 1 + usr.bin/mandoc/tbl_data.c | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/regress/usr.bin/mandoc/tbl/data/block_unclosed.in b/regress/usr.bin/mandoc/tbl/data/block_unclosed.in index c7c97286c47..5e3526c4d7a 100644 --- a/regress/usr.bin/mandoc/tbl/data/block_unclosed.in +++ b/regress/usr.bin/mandoc/tbl/data/block_unclosed.in @@ -9,6 +9,11 @@ lll. begin:T{ middle T}:end +T{ +begin +T}:middle:T{ +end +T} incomplete:T{ block .TE diff --git a/regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii b/regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii index d69d972f7cd..bf0338ce982 100644 --- a/regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii +++ b/regress/usr.bin/mandoc/tbl/data/block_unclosed.out_ascii @@ -10,6 +10,7 @@ DDEESSCCRRIIPPTTIIOONN +--------------------------+ |begin middle end | + |begin middle end | |incomplete block | +--------------------------+ normal text diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c index 972868ff189..417199169a2 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.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 * Copyright (c) 2011, 2015 Ingo Schwarze @@ -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; -- 2.20.1