summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 139fa875..2fb4dc44 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -23,6 +23,7 @@
#include <string.h>
#include "libmdoc.h"
+#include "libmandoc.h"
/* FIXME: .Bl -diag can't have non-text children in HEAD. */
/* TODO: ignoring Pp (it's superfluous in some invocations). */
@@ -708,9 +709,9 @@ check_argv(struct mdoc *m, const struct mdoc_node *n,
static int
check_text(struct mdoc *mdoc, int line, int pos, const char *p)
{
- size_t c;
+ int c;
- for ( ; *p; p++) {
+ for ( ; *p; p++, pos++) {
if ('\t' == *p) {
if ( ! (MDOC_LITERAL & mdoc->flags))
if ( ! warn_print(mdoc, line, pos))
@@ -722,9 +723,10 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
if ('\\' != *p)
continue;
- c = mdoc_isescape(p);
+ c = mandoc_special(p);
if (c) {
- p += (int)c - 1;
+ p += c - 1;
+ pos += c - 1;
continue;
}
if ( ! (MDOC_IGN_ESCAPE & mdoc->pflags))