From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 36fdb165 for ; Thu, 11 Jul 2019 12:06:21 -0500 (EST) Date: Thu, 11 Jul 2019 12:06:21 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: When parsing a tab character that is not preceded by a space X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <8629f2b87f24f447@mandoc.bsd.lv> Log Message: ----------- When parsing a tab character that is not preceded by a space character on an .It -column line, args() sets the MDOC_PHRASEQL flag to Quote the Last word of the Phrase. Even if it turns out this quoting is not needed because the word is already quoted for other reasons, clear the flag at the end of parsing the phrase, such that the flag does not leak to the next phrase. This patch fixes the bug that the trailing Macro on a line of the form .It "wordword" Ta word Macro was incorrectly considered quoted and hence not parsed. Bug found by Havard Eidnes (he@) with the NetBSD gettytab(5) manual page: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54361 Reported via Thomas Klausner (wiz@). Modified Files: -------------- mandoc: mdoc_argv.c mandoc/regress/mdoc/Bl: column.in column.out_ascii column.out_lint column.out_markdown Revision Data ------------- Index: mdoc_argv.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mdoc_argv.c,v retrieving revision 1.119 retrieving revision 1.120 diff -Lmdoc_argv.c -Lmdoc_argv.c -u -p -r1.119 -r1.120 --- mdoc_argv.c +++ mdoc_argv.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2012, 2014-2018 Ingo Schwarze + * Copyright (c) 2012, 2014-2019 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -454,6 +454,7 @@ args(struct roff_man *mdoc, int line, in mandoc_msg(MANDOCERR_ARG_QUOTE, line, *pos, NULL); mdoc->flags &= ~MDOC_PHRASELIT; } + mdoc->flags &= ~MDOC_PHRASEQL; return ARGS_EOLN; } Index: column.in =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bl/column.in,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/mdoc/Bl/column.in -Lregress/mdoc/Bl/column.in -u -p -r1.3 -r1.4 --- regress/mdoc/Bl/column.in +++ regress/mdoc/Bl/column.in @@ -1,4 +1,4 @@ -.\" $OpenBSD: column.in,v 1.10 2017/07/04 14:53:24 schwarze Exp $ +.\" $OpenBSD: column.in,v 1.11 2019/07/11 16:56:52 schwarze Exp $ .Dd $Mdocdate$ .Dt BL-COLUMN 1 .Os @@ -81,7 +81,8 @@ .\" Mixed tab and Ta .Bl -column a b c d .It a b c d -.It a b c Ta d +.It "a b c" Ta +d .It a b Ta c d .It a b Ta c Ta d .It a Ta b c d Index: column.out_markdown =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bl/column.out_markdown,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/mdoc/Bl/column.out_markdown -Lregress/mdoc/Bl/column.out_markdown -u -p -r1.2 -r1.3 --- regress/mdoc/Bl/column.out_markdown +++ regress/mdoc/Bl/column.out_markdown @@ -75,4 +75,4 @@ BL-COLUMN(1) - General Commands Manual aa bb cc dd -OpenBSD - July 4, 2017 +OpenBSD - July 11, 2019 Index: column.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bl/column.out_ascii,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/mdoc/Bl/column.out_ascii -Lregress/mdoc/Bl/column.out_ascii -u -p -r1.2 -r1.3 --- regress/mdoc/Bl/column.out_ascii +++ regress/mdoc/Bl/column.out_ascii @@ -71,4 +71,4 @@ DDEESSCCRRIIPPTTIIOONN aa bb tab at eol aa bb cc dd -OpenBSD July 4, 2017 OpenBSD +OpenBSD July 11, 2019 OpenBSD Index: column.out_lint =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bl/column.out_lint,v retrieving revision 1.6 retrieving revision 1.7 diff -Lregress/mdoc/Bl/column.out_lint -Lregress/mdoc/Bl/column.out_lint -u -p -r1.6 -r1.7 --- regress/mdoc/Bl/column.out_lint +++ regress/mdoc/Bl/column.out_lint @@ -4,4 +4,4 @@ mandoc: column.in:75:2: WARNING: skippin mandoc: column.in:77:2: WARNING: wrong number of cells: 2 columns, 4 cells mandoc: column.in:78:2: WARNING: wrong number of cells: 2 columns, 5 cells mandoc: column.in:79:2: WARNING: skipping empty macro: It -mandoc: column.in:107:18: WARNING: skipping -width argument: Bl -column +mandoc: column.in:108:18: WARNING: skipping -width argument: Bl -column -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv