From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 7a5d439c for ; Sun, 21 Apr 2019 10:29:06 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1hIEOv-0003oY-0u; Sun, 21 Apr 2019 17:29:05 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1hIEOu-0002g5-LX; Sun, 21 Apr 2019 17:29:04 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1hIEOu-0002zN-IU; Sun, 21 Apr 2019 17:29:04 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id f54a8046; Sun, 21 Apr 2019 17:29:04 +0200 (CEST) Date: Sun, 21 Apr 2019 17:29:04 +0200 From: Ingo Schwarze To: Jan Stary Cc: discuss@mandoc.bsd.lv Subject: Re: docbook2mdoc-1.0.0 released Message-ID: <20190421152904.GC31325@athene.usta.de> References: <20190417192435.GA10272@athene.usta.de> <20190420190331.GA36463@www.stare.cz> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190420190331.GA36463@www.stare.cz> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Jan, Jan Stary wrote on Sat, Apr 20, 2019 at 09:03:31PM +0200: > https://github.com/janstary/manpages/tree/master/wavpack > > One thing I noticed with the mdoc output: > > .It Fl -clean, Fl -clear You found a bug, and i fixed it with the commit below. Thanks for reporting, Ingo 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 discuss+unsubscribe@mandoc.bsd.lv