source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: fix handling of empty .An macros
Date: Wed, 4 Feb 2015 20:47:26 -0500 (EST)	[thread overview]
Message-ID: <1728382546005188724.enqueue@fantadrom.bsd.lv> (raw)

Log Message:
-----------
fix handling of empty .An macros

Modified Files:
--------------
    mdocml:
        mdoc_html.c
        mdoc_macro.c
        mdoc_term.c
        mdoc_validate.c

Revision Data
-------------
Index: mdoc_macro.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_macro.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.175 -r1.176
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -772,7 +772,7 @@ in_line(MACRO_PROT_ARGS)
 		 */
 
 		if (ac == ARGS_PUNCT) {
-			if (cnt == 0 && nc == 0)
+			if (cnt == 0 && (nc == 0 || tok == MDOC_An))
 				mdoc->flags |= MDOC_NODELIMC;
 			break;
 		}
Index: mdoc_term.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_term.c,v
retrieving revision 1.307
retrieving revision 1.308
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.307 -r1.308
--- mdoc_term.c
+++ mdoc_term.c
@@ -1091,9 +1091,6 @@ termp_an_pre(DECL_ARGS)
 		return(0);
 	}
 
-	if (n->child == NULL)
-		return(0);
-
 	if (p->flags & TERMP_SPLIT)
 		term_newln(p);
 
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v
retrieving revision 1.222
retrieving revision 1.223
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.222 -r1.223
--- mdoc_html.c
+++ mdoc_html.c
@@ -1253,9 +1253,6 @@ mdoc_an_pre(MDOC_ARGS)
 		return(0);
 	}
 
-	if (n->child == NULL)
-		return(0);
-
 	if (h->flags & HTML_SPLIT)
 		print_otag(h, TAG_BR, 0, NULL);
 
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v
retrieving revision 1.270
retrieving revision 1.271
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.270 -r1.271
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -1168,10 +1168,12 @@ post_an(POST_ARGS)
 	struct mdoc_node *np, *nch;
 
 	np = mdoc->last;
-	if (AUTH__NONE == np->norm->An.auth) {
-		if (0 == np->child)
-			check_count(mdoc, MDOC_ELEM, CHECK_GT, 0);
-	} else if ((nch = np->child) != NULL)
+	nch = np->child;
+	if (np->norm->An.auth == AUTH__NONE) {
+		if (nch == NULL)
+			mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse,
+			    np->line, np->pos, "An");
+	} else if (nch != NULL)
 		mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse,
 		    nch->line, nch->pos, "An ... %s", nch->string);
 }
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2015-02-05  1:47 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=1728382546005188724.enqueue@fantadrom.bsd.lv \
    --to=schwarze@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).