source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Remove the warning for empty bodies of `Sh', `Ss', `SH', and
@ 2011-04-13  9:57 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-04-13  9:57 UTC (permalink / raw)
  To: source

Log Message:
-----------
Remove the warning for empty bodies of `Sh', `Ss', `SH', and `SS'.  This
prompted by a TODO by schwarze@, originally from Gleydson Soares, that
an empty `SS' was raising an error (it hasn't for some time).  It makes
sense these shouldn't warn, as omitting their contents doesn't change
anything in the structure of the document (groff and mandoc specifically
account for the whitespace between empty sections).

This doesn't change any manuals, which only refer to the line arguments
(or possibly next-line, in the case of man(7) syntax).

Modified Files:
--------------
    mdocml:
        man_validate.c
        mdoc_validate.c

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.167 -r1.168
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -155,9 +155,9 @@ static	v_post	 posts_notext[] = { ewarn_
 static	v_post	 posts_ns[] = { post_ns, NULL };
 static	v_post	 posts_os[] = { post_os, post_prol, NULL };
 static	v_post	 posts_rs[] = { post_rs, NULL };
-static	v_post	 posts_sh[] = { post_ignpar, hwarn_ge1, bwarn_ge1, post_sh, NULL };
+static	v_post	 posts_sh[] = { post_ignpar, hwarn_ge1, post_sh, NULL };
 static	v_post	 posts_sp[] = { ewarn_le1, NULL };
-static	v_post	 posts_ss[] = { post_ignpar, hwarn_ge1, bwarn_ge1, NULL };
+static	v_post	 posts_ss[] = { post_ignpar, hwarn_ge1, NULL };
 static	v_post	 posts_st[] = { post_st, NULL };
 static	v_post	 posts_std[] = { post_std, NULL };
 static	v_post	 posts_text[] = { ewarn_ge1, NULL };
Index: man_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_validate.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -Lman_validate.c -Lman_validate.c -u -p -r1.68 -r1.69
--- man_validate.c
+++ man_validate.c
@@ -325,14 +325,11 @@ static int
 check_sec(CHKARGS)
 {
 
-	if (MAN_HEAD == n->type && 0 == n->nchild) {
-		man_nmsg(m, n, MANDOCERR_SYNTARGCOUNT);
-		return(0);
-	} else if (MAN_BODY == n->type && 0 == n->nchild)
-		mandoc_msg(MANDOCERR_ARGCWARN, m->parse, n->line, 
-				n->pos, "want children (have none)");
+	if ( ! (MAN_HEAD == n->type && 0 == n->nchild)) 
+		return(1);
 
-	return(1);
+	man_nmsg(m, n, MANDOCERR_SYNTARGCOUNT);
+	return(0);
 }
 
 
--
 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:[~2011-04-13  9:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13  9:57 mdocml: Remove the warning for empty bodies of `Sh', `Ss', `SH', and kristaps

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