diff options
-rw-r--r-- | man_validate.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/man_validate.c b/man_validate.c index 0df8fc1f..39380fa3 100644 --- a/man_validate.c +++ b/man_validate.c @@ -52,6 +52,7 @@ static int check_le5(CHKARGS); static int check_par(CHKARGS); static int check_part(CHKARGS); static int check_root(CHKARGS); +static void check_text(CHKARGS); static int post_AT(CHKARGS); static int post_vs(CHKARGS); @@ -152,10 +153,11 @@ man_valid_post(struct man *m) m->last->flags |= MAN_VALID; switch (m->last->type) { + case (MAN_TEXT): + check_text(m, m->last); + return(1); case (MAN_ROOT): return(check_root(m, m->last)); - case (MAN_TEXT): - /* FALLTHROUGH */ case (MAN_EQN): /* FALLTHROUGH */ case (MAN_TBL): @@ -206,6 +208,19 @@ check_root(CHKARGS) return(1); } +static void +check_text(CHKARGS) +{ + char *cp, *p; + + cp = p = n->string; + for (cp = p; NULL != (p = strchr(p, '\t')); p++) { + if (MAN_LITERAL & m->flags) + continue; + man_pmsg(m, n->line, (int)(p - cp), MANDOCERR_BADTAB); + } +} + #define INEQ_DEFINE(x, ineq, name) \ static int \ check_##name(CHKARGS) \ |