From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 2debab3a; for ; Fri, 30 Oct 2015 14:04:47 -0500 (EST) Date: Fri, 30 Oct 2015 14:04:47 -0500 (EST) Message-Id: <16189704011536921157.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: If a .Bd block has no arguments at all, drop the block and only X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- If a .Bd block has no arguments at all, drop the block and only keep its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@. Modified Files: -------------- mdocml: mandoc.1 mandoc.h mdoc.c mdoc_validate.c read.c Revision Data ------------- Index: mandoc.1 =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v retrieving revision 1.162 retrieving revision 1.163 diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.162 -r1.163 --- mandoc.1 +++ mandoc.1 @@ -1600,6 +1600,13 @@ By requesting the inclusion of a sensiti might otherwise trick a privileged user into inadvertently displaying the file on the screen, revealing the file content to bystanders. The argument is ignored including the file name following it. +.It Sy "skipping display without arguments" +.Pq mdoc +A +.Ic \&Bd +block macro does not have any arguments. +The block is discarded, and the block content is displayed in +whatever mode was active before the block. .It Sy "missing list type, using -item" .Pq mdoc A Index: mandoc.h =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v retrieving revision 1.206 retrieving revision 1.207 diff -Lmandoc.h -Lmandoc.h -u -p -r1.206 -r1.207 --- mandoc.h +++ mandoc.h @@ -172,6 +172,7 @@ enum mandocerr { /* related to request and macro arguments */ MANDOCERR_NAMESC, /* escaped character not allowed in a name: name */ MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */ + MANDOCERR_BD_NOARG, /* skipping display without arguments: Bd */ MANDOCERR_BL_NOTYPE, /* missing list type, using -item: Bl */ MANDOCERR_NM_NONAME, /* missing manual name, using "": Nm */ MANDOCERR_OS_UNAME, /* uname(3) system call failed, using UNKNOWN */ Index: mdoc_validate.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v retrieving revision 1.299 retrieving revision 1.300 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.299 -r1.300 --- mdoc_validate.c +++ mdoc_validate.c @@ -895,6 +895,16 @@ post_display(POST_ARGS) break; case ROFFT_BLOCK: if (n->tok == MDOC_Bd) { + if (n->args == NULL) { + mandoc_msg(MANDOCERR_BD_NOARG, + mdoc->parse, n->line, n->pos, "Bd"); + mdoc->next = ROFF_NEXT_SIBLING; + while (n->body->child != NULL) + mdoc_node_relink(mdoc, + n->body->child); + roff_node_delete(mdoc, n); + break; + } post_bd(mdoc); post_prevpar(mdoc); } Index: mdoc.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc.c,v retrieving revision 1.255 retrieving revision 1.256 diff -Lmdoc.c -Lmdoc.c -u -p -r1.255 -r1.256 --- mdoc.c +++ mdoc.c @@ -205,6 +205,7 @@ mdoc_node_relink(struct roff_man *mdoc, { roff_node_unlink(mdoc, p); + p->prev = p->next = NULL; roff_node_append(mdoc, p); } Index: read.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/read.c,v retrieving revision 1.144 retrieving revision 1.145 diff -Lread.c -Lread.c -u -p -r1.144 -r1.145 --- read.c +++ read.c @@ -215,6 +215,7 @@ static const char * const mandocerrs[MAN /* related to request and macro arguments */ "escaped character not allowed in a name", "NOT IMPLEMENTED: Bd -file", + "skipping display without arguments", "missing list type, using -item", "missing manual name, using \"\"", "uname(3) system call failed, using UNKNOWN", -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv