From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: [PATCH] empty bodies are OK in list items
Date: Fri, 2 Jul 2010 01:45:38 +0200 [thread overview]
Message-ID: <20100701234538.GC26206@iris.usta.de> (raw)
Hi,
here is a minor tweak:
For -hang, -ohang, -inset, -diag and -item lists,
empty bodies are OK, they do not even warrant a warning.
See e.g. OpenBSD options(4) "option NKMEMPAGES*" for a nice
example.
OK?
Yours,
Ingo
Index: mdoc_validate.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/mdoc_validate.c,v
retrieving revision 1.63
diff -u -p -r1.63 mdoc_validate.c
--- mdoc_validate.c 27 Jun 2010 21:54:42 -0000 1.63
+++ mdoc_validate.c 1 Jul 2010 23:38:29 -0000
@@ -1067,9 +1067,6 @@ post_it(POST_ARGS)
if (NULL == mdoc->last->head->child)
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOARGS))
return(0);
- if (NULL == mdoc->last->body->child)
- if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY))
- return(0);
break;
case (LIST_bullet):
/* FALLTHROUGH */
@@ -1078,13 +1075,13 @@ post_it(POST_ARGS)
case (LIST_enum):
/* FALLTHROUGH */
case (LIST_hyphen):
+ if (NULL == mdoc->last->body->child)
+ if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY))
+ return(0);
/* FALLTHROUGH */
case (LIST_item):
if (mdoc->last->head->child)
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_ARGSLOST))
- return(0);
- if (NULL == mdoc->last->body->child)
- if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY))
return(0);
break;
case (LIST_column):
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
next reply other threads:[~2010-07-01 23:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 23:45 Ingo Schwarze [this message]
2010-07-02 10:27 ` Kristaps Dzonsons
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=20100701234538.GC26206@iris.usta.de \
--to=schwarze@usta.de \
--cc=tech@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).