source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Using user-defined macros, surprisingly, it is possible  to have
@ 2011-09-20 14:20 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2011-09-20 14:20 UTC (permalink / raw)
  To: source

Log Message:
-----------
Using user-defined macros, surprisingly, it is possible 
to have *next*-line head arguments on the *same* input line.
So .TP must not assume that a head argument with a matching
input line number is a same-line argument (and access a NULL pointer).
Bug found and fix tested by kristaps@ with groff_hdtbl(7).

Modified Files:
--------------
    mdocml:
        TODO
        man_term.c

Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -Lman_term.c -Lman_term.c -u -p -r1.119 -r1.120
--- man_term.c
+++ man_term.c
@@ -640,7 +640,7 @@ pre_TP(DECL_ARGS)
 	/* Calculate offset. */
 
 	if (NULL != (nn = n->parent->head->child))
-		if (nn->parent->line == nn->line)
+		if (nn->string && nn->parent->line == nn->line)
 			if ((ival = a2width(p, nn->string)) >= 0)
 				len = (size_t)ival;
 
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.121
retrieving revision 1.122
diff -LTODO -LTODO -u -p -r1.121 -r1.122
--- TODO
+++ TODO
@@ -350,6 +350,10 @@ Several areas can be cleaned up to make 
 * structural issues
 ************************************************************************
 
+- We use the input line number at several places to distinguish
+  same-line from different-line input.  That plainly doesn't work
+  with user-defined macros, leading to random breakage.
+
 - Find better ways to prevent endless loops
   in roff(7) macro and string expansion.
  
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-20 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-20 14:20 mdocml: Using user-defined macros, surprisingly, it is possible to have schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).