From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: drop trailing parentheses in <function> elements
Date: Wed, 1 May 2019 06:04:01 -0500 (EST) [thread overview]
Message-ID: <e3fed8b76aa16ea5@fantadrom.bsd.lv> (raw)
Log Message:
-----------
drop trailing parentheses in <function> elements
Modified Files:
--------------
docbook2mdoc:
reorg.c
Revision Data
-------------
Index: reorg.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/reorg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lreorg.c -Lreorg.c -u -p -r1.5 -r1.6
--- reorg.c
+++ reorg.c
@@ -211,6 +211,20 @@ default_title(struct pnode *n, const cha
}
static void
+reorg_function(struct pnode *n)
+{
+ struct pnode *nc;
+ size_t sz;
+
+ if ((nc = TAILQ_FIRST(&n->childq)) != NULL &&
+ nc->node == NODE_TEXT &&
+ TAILQ_NEXT(nc, child) == NULL &&
+ (sz = strlen(nc->b)) > 2 &&
+ nc->b[sz - 2] == '(' && nc->b[sz - 1] == ')')
+ nc->b[sz - 2] = '\0';
+}
+
+static void
reorg_recurse(struct pnode *n)
{
struct pnode *nc;
@@ -231,6 +245,9 @@ reorg_recurse(struct pnode *n)
case NODE_CAUTION:
default_title(n, "Caution");
n->node = NODE_NOTE;
+ break;
+ case NODE_FUNCTION:
+ reorg_function(n);
break;
case NODE_LEGALNOTICE:
default_title(n, "Legal Notice");
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
reply other threads:[~2019-05-01 11:04 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=e3fed8b76aa16ea5@fantadrom.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.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).