source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: docbook2mdoc: citerefentry shouldn't expect a newline--it can occur
Date: Wed, 30 Apr 2014 05:37:26 -0400 (EDT)	[thread overview]
Message-ID: <201404300937.s3U9bQYO004861@krisdoz.my.domain> (raw)

Log Message:
-----------
citerefentry shouldn't expect a newline--it can occur inline.

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

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.33 -r1.34
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -693,16 +693,12 @@ pnode_printciterefentry(struct parse *p,
 	struct pnode	*pp, *title, *manvol;
 
 	title = manvol = NULL;
-	assert(p->newln);
 	TAILQ_FOREACH(pp, &pn->childq, child)
 		if (NODE_MANVOLNUM == pp->node)
 			manvol = pp;
 		else if (NODE_REFENTRYTITLE == pp->node)
 			title = pp;
 
-	fputs(".Xr", stdout);
-	p->newln = 0;
-
 	if (NULL != title) {
 		pnode_printmacrolinepart(p, title);
 	} else
@@ -712,7 +708,7 @@ pnode_printciterefentry(struct parse *p,
 		puts(" 1");
 		p->newln = 1;
 	} else
-		pnode_printmacroline(p, manvol);
+		pnode_printmacrolinepart(p, manvol);
 }
 
 static void
@@ -1087,7 +1083,8 @@ pnode_print(struct parse *p, struct pnod
 		pnode_unlinksub(pn);
 		break;
 	case (NODE_CITEREFENTRY):
-		assert(p->newln);
+		pnode_printmopen(p);
+		fputs("Xr", stdout);
 		pnode_printciterefentry(p, pn);
 		pnode_unlinksub(pn);
 		break;
@@ -1309,6 +1306,7 @@ pnode_print(struct parse *p, struct pnod
 	switch (pn->node) {
 	case (NODE_APPLICATION):
 	case (NODE_ARG):
+	case (NODE_CITEREFENTRY):
 	case (NODE_CODE):
 	case (NODE_COMMAND):
 	case (NODE_CONSTANT):
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-04-30  9:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201404300937.s3U9bQYO004861@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).