source@mandoc.bsd.lv
 help / color / Atom feed
* docbook2mdoc: When moving the last word of a text node into its own node 
@ 2019-05-02  4:09 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-05-02  4:09 UTC (permalink / raw)
  To: source

Log Message:
-----------
When moving the last word of a text node into its own node
for use with .Pf before a macro node, make sure what remains
of the original text node isn't leading whitespace only.

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

Revision Data
-------------
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -Lparse.c -Lparse.c -u -p -r1.57 -r1.58
--- parse.c
+++ parse.c
@@ -354,12 +354,12 @@ pnode_closetext(struct parse *p, int che
 
 	while (cp > n->b && !isspace((unsigned char)cp[-1]))
 		cp--;
-	if (cp == n->b)
-		return;
-
 	last_word = cp;
 	while (cp > n->b && isspace((unsigned char)cp[-1]))
-	    *--cp = '\0';
+		cp--;
+	if (cp == n->b)
+		return;
+	*cp = '\0';
 
 	/* Move the last word into its own node, for use with .Pf. */
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  4:09 docbook2mdoc: When moving the last word of a text node into its own node schwarze

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git