From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20755 invoked from network); 16 Aug 2022 23:01:42 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 16 Aug 2022 23:01:42 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 10f2876d for ; Tue, 16 Aug 2022 18:01:40 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 3b94def8 for ; Tue, 16 Aug 2022 18:01:40 -0500 (EST) Date: Tue, 16 Aug 2022 18:01:40 -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: Restore the traditional behaviour of the man(7) single-font X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <336a3b3a821f723f@mandoc.bsd.lv> Log Message: ----------- Restore the traditional behaviour of the man(7) single-font macros .B, .I, .SM, and .SB that the next-line scope extends to the end of the next logical input line and is not extended if that line ends with a \c (no-space) escape sequence. While improving a loosely related feature in the man(7) .TP macro, a regression entered the groff codebase in groff commit 3549fd9f (28-Apr-2017) caused by the usual sloppiness of Bjarni Ingi Gislason. Since that time, groff wrongly had \c extend next-line scope to a second line for these macros. In man.c rev. 1.127 (25-Aug-2018) i synched mandoc behaviour with groff in this respect, unfortunately failing to notice the recent regression in groff. The groff regression was finally fixed by gbranden@ in commit 09c028f3 (07-Jun-2022). With the present commit, mandoc is back in sync with both GNU and Heirloom roff regarding the interaction of single-font macros with \c. Modified Files: -------------- mandoc: man.c Revision Data ------------- Index: man.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/man.c,v retrieving revision 1.188 retrieving revision 1.189 diff -Lman.c -Lman.c -u -p -r1.188 -r1.189 --- man.c +++ man.c @@ -76,16 +76,7 @@ man_hasc(char *start) void man_descope(struct roff_man *man, int line, int offs, char *start) { - /* Trailing \c keeps next-line scope open. */ - - if (start != NULL && man_hasc(start) != NULL) - return; - - /* - * Co-ordinate what happens with having a next-line scope open: - * first close out the element scopes (if applicable), - * then close out the block scope (also if applicable). - */ + /* First close out all next-line element scopes, if any. */ if (man->flags & MAN_ELINE) { while (man->last->parent->type != ROFFT_ROOT && @@ -93,6 +84,14 @@ man_descope(struct roff_man *man, int li man_unscope(man, man->last->parent); man->flags &= ~MAN_ELINE; } + + /* Trailing \c keeps next-line block scope open. */ + + if (start != NULL && man_hasc(start) != NULL) + return; + + /* Close out the next-line block scope, if there is one. */ + if ( ! (man->flags & MAN_BLINE)) return; man_unscope(man, man->last->parent); -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv