summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-02-02 21:40:45 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-02-02 21:40:45 +0000
commitfe1e1c9e6ff55e0dc447b3cbe2c90acec57abb94 (patch)
tree41487390a8b9f98c9f16c129452bb52b69fae3ec /mdoc_validate.c
parent4d5fae7359175bce01187d32473e257174341f84 (diff)
downloadmandoc-fe1e1c9e6ff55e0dc447b3cbe2c90acec57abb94.tar.gz
If `Ns' is specified on its own line, it should be ignored. This is
shitty groff behaviour. Do the same, but raise a warning to this effect. This from a TODO noted by schwarze@.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index c8d65144..1b6fd138 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -104,6 +104,7 @@ static int post_eoln(POST_ARGS);
static int post_it(POST_ARGS);
static int post_lb(POST_ARGS);
static int post_nm(POST_ARGS);
+static int post_ns(POST_ARGS);
static int post_os(POST_ARGS);
static int post_ignpar(POST_ARGS);
static int post_prol(POST_ARGS);
@@ -148,6 +149,7 @@ static v_post posts_lb[] = { post_lb, NULL };
static v_post posts_nd[] = { berr_ge1, NULL };
static v_post posts_nm[] = { post_nm, NULL };
static v_post posts_notext[] = { ewarn_eq0, NULL };
+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 };
@@ -249,7 +251,7 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Fx */
{ NULL, NULL }, /* Ms */
{ NULL, posts_notext }, /* No */
- { NULL, posts_notext }, /* Ns */
+ { NULL, posts_ns }, /* Ns */
{ NULL, NULL }, /* Nx */
{ NULL, NULL }, /* Ox */
{ NULL, NULL }, /* Pc */
@@ -1744,6 +1746,15 @@ post_rs(POST_ARGS)
}
static int
+post_ns(POST_ARGS)
+{
+
+ if (MDOC_LINE & mdoc->last->flags)
+ mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_IGNNS);
+ return(1);
+}
+
+static int
post_sh(POST_ARGS)
{