source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: Discard attributes of ignored elements.
@ 2019-04-07 17:39 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-07 17:39 UTC (permalink / raw)
  To: source

Log Message:
-----------
Discard attributes of ignored elements.
As a side benefit, this avoids a null pointer access
if the document element is ignored and has attributes.

Modified Files:
--------------
    docbook2mdoc:
        parse.c

Revision Data
-------------
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lparse.c -Lparse.c -u -p -r1.18 -r1.19
--- parse.c
+++ parse.c
@@ -518,7 +518,7 @@ xml_attrkey(struct parse *ps, const char
 	struct pattr	*attr;
 	enum attrkey	 key;
 
-	if (ps->del > 0 || *name == '\0')
+	if (ps->del > 0 || ps->ncur == NODE_IGNORE || *name == '\0')
 		return;
 	if ((key = attrkey_parse(name)) == ATTRKEY__MAX) {
 		ps->attr = 0;
@@ -540,7 +540,7 @@ xml_attrval(struct parse *ps, const char
 {
 	struct pattr	*attr;
 
-	if (ps->del > 0 || ps->attr == 0)
+	if (ps->del > 0 || ps->ncur == NODE_IGNORE || ps->attr == 0)
 		return;
 	if ((attr = TAILQ_LAST(&ps->cur->attrq, pattrq)) == NULL)
 		return;
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

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

only message in thread, other threads:[~2019-04-07 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-07 17:39 docbook2mdoc: Discard attributes of ignored elements 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).