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 9fd80078 for ; Thu, 26 Dec 2019 14:52:21 -0500 (EST) Date: Thu, 26 Dec 2019 14:52: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: Do not fail an assertion when a high level macro occurs in the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- Do not fail an assertion when a high level macro occurs in the body of a conditional inside a .ce request block. Instead, abort the .ce block just like when there is no conditional in between. Bug found by espie@ working on the textproc/fstrcmp port. Modified Files: -------------- mandoc: roff.c Revision Data ------------- Index: roff.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/roff.c,v retrieving revision 1.367 retrieving revision 1.368 diff -Lroff.c -Lroff.c -u -p -r1.367 -r1.368 --- roff.c +++ roff.c @@ -2294,12 +2294,24 @@ roff_cond_sub(ROFF_ARGS) } } + t = roff_parse(r, buf->buf, &pos, ln, ppos); + + /* For now, let high level macros abort .ce mode. */ + + if (roffce_node != NULL && + (t == TOKEN_NONE || t == ROFF_Dd || t == ROFF_EQ || + t == ROFF_TH || t == ROFF_TS)) { + r->man->last = roffce_node; + r->man->next = ROFF_NEXT_SIBLING; + roffce_lines = 0; + roffce_node = NULL; + } + /* * Fully handle known macros when they are structurally * required or when the conditional evaluated to true. */ - t = roff_parse(r, buf->buf, &pos, ln, ppos); if (t == ROFF_break) { if (irc & ROFF_LOOPMASK) irc = ROFF_IGN | ROFF_LOOPEXIT; -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv