From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 2ea7e6ec for ; Sun, 21 Apr 2019 10:24:35 -0500 (EST) Date: Sun, 21 Apr 2019 10:24:35 -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: docbook2mdoc: When contains a macro-generating element, the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- When contains a macro-generating element, the subsequent comma needs spacing. Fixing a bug reported by Jan Stary . Modified Files: -------------- docbook2mdoc: docbook2mdoc.c Revision Data ------------- Index: docbook2mdoc.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.132 retrieving revision 1.133 diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.132 -r1.133 --- docbook2mdoc.c +++ docbook2mdoc.c @@ -929,16 +929,17 @@ pnode_printrefentry(struct format *f, st static void pnode_printvarlistentry(struct format *f, struct pnode *n) { - struct pnode *nc, *nn; - int first = 1; + struct pnode *nc, *nn, *ncc; + int comma; macro_open(f, "It"); f->parastate = PARA_HAVE; f->flags |= FMT_IMPL; + comma = -1; TAILQ_FOREACH_SAFE(nc, &n->childq, child, nn) { if (nc->node != NODE_TERM && nc->node != NODE_GLOSSTERM) continue; - if (first == 0) { + if (comma != -1) { switch (f->linestate) { case LINE_NEW: break; @@ -946,14 +947,15 @@ pnode_printvarlistentry(struct format *f print_text(f, ",", 0); break; case LINE_MACRO: - macro_addarg(f, ",", 0); + macro_addarg(f, ",", comma); break; } } f->parastate = PARA_HAVE; + comma = (ncc = TAILQ_FIRST(&nc->childq)) == NULL || + pnode_class(ncc->node) == CLASS_TEXT ? 0 : ARG_SPACE; pnode_print(f, nc); pnode_unlink(nc); - first = 0; } macro_close(f); f->parastate = PARA_HAVE; -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv