summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-04 09:01:55 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-04 09:01:55 +0000
commit4731011d94a8295f8bf499ee10709029a5ac9f4a (patch)
tree029371328cc51743d850eecdc97ab2d9d1d7256b /mdoc_validate.c
parentb446ffedf453a9238f7514a3d1ca6d8ac7489f03 (diff)
downloadmandoc-4731011d94a8295f8bf499ee10709029a5ac9f4a.tar.gz
Moved escape validation into libmandoc.h/mandoc.c (common between libman/libmdoc1).
libman supports MAN_IGN_ESCAPE (like MDOC_IGN_ESCAPE). All popular escapes now handled consistently.
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))