source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: fix handling of empty .An macros
@ 2015-02-05  1:47 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-02-05  1:47 UTC (permalink / raw)
  To: source

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

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

only message in thread, other threads:[~2015-02-05  1:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05  1:47 mdocml: fix handling of empty .An macros schwarze

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).