summaryrefslogtreecommitdiffstats
path: root/man_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-09-06 17:53:50 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-09-06 17:53:50 +0000
commitc2dcf0f015dd488ffb01f0a750e26b715011ed64 (patch)
tree680cd9dffe4572e467264389de4c4b71d53dc109 /man_validate.c
parent1bb6aaaf519b9a13fc8a1438d9b18ed3f02640b8 (diff)
downloadmandoc-c2dcf0f015dd488ffb01f0a750e26b715011ed64.tar.gz
Revert removal of tab warning, suggested by schwarze@.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c19
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) \