Hi Kristaps,
kristaps@mdocml.bsd.lv wrote on Mon, Jan 02, 2012 at 10:48:06AM -0500:
> `-diag' lists aren't parsed, unlike other list types.
> This fixes a TODO entry raised by deraadt@.
i hate to say so, but this fix is incomplete:
It only fixes the first .It macro in each -diag list.
To fix the subsequent ones as well, the check
has to be moved after the creation of the .It block,
such that we can look for the parent.
While moving the check, we can drop the if-statement
and make the comment more precise.
OK?
Ingo
CVSROOT: /cvs
Module name: src
Changes by: schwarze@cvs.openbsd.org 2012/01/03 19:17:42
Modified files:
usr.bin/mandoc : mdoc_macro.c
regress/usr.bin/mandoc/mdoc/Bl: diag.in diag.out_ascii
Log message:
Heads of .It macros in -diag lists are not parsed,
even though .It macros in general are parsed.
Fixing a bug reported by deraadt@,
based on an incomplete fix by kristaps@,
and update the test suite to catch this issue.
--- /co/mdocml/mdoc_macro.c Wed Jan 4 03:24:13 2012
+++ ./mdoc_macro.c Wed Jan 4 03:17:42 2012
@@ -994,16 +990,6 @@
enum margverr av;
char *p;
- /*
- * Exception: `-diag' lists are not parsed, but lists in general
- * are parsed.
- */
- nparsed = 0;
- if (MDOC_It == tok && NULL != m->last &&
- MDOC_Bl == m->last->tok &&
- LIST_diag == m->last->norm->Bl.type)
- nparsed = 1;
-
nl = MDOC_NEWLINE & m->flags;
/* Close out prior implicit scope. */
@@ -1046,6 +1032,14 @@
return(0);
head = body = NULL;
+
+ /*
+ * Exception: Heads of `It' macros in `-diag' lists are not
+ * parsed, even though `It' macros in general are parsed.
+ */
+ nparsed = MDOC_It == tok &&
+ MDOC_Bl == m->last->parent->tok &&
+ LIST_diag == m->last->parent->norm->Bl.type;
/*
* The `Nd' macro has all arguments in its body: it's a hybrid
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv