From f6854d5ca3fcac678f129f074109501c0fbadcbb Mon Sep 17 00:00:00 2001 From: schwarze Date: Wed, 8 Jul 2009 00:04:10 +0000 Subject: sync to 1.7.21: unified escape sequence validation for mdoc and man checking is still incomplete, but a bit better, in particular for man now in sync with 1.7.22: the only 1.7.22 diff was already in --- usr.bin/mandoc/mdoc_strings.c | 80 ++----------------------------------------- 1 file changed, 2 insertions(+), 78 deletions(-) (limited to 'usr.bin/mandoc/mdoc_strings.c') diff --git a/usr.bin/mandoc/mdoc_strings.c b/usr.bin/mandoc/mdoc_strings.c index de00025fb85..7b561fa264c 100644 --- a/usr.bin/mandoc/mdoc_strings.c +++ b/usr.bin/mandoc/mdoc_strings.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_strings.c,v 1.7 2009/06/21 20:21:09 schwarze Exp $ */ +/* $Id: mdoc_strings.c,v 1.8 2009/07/08 00:04:10 schwarze Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -55,82 +54,6 @@ static const struct mdoc_secname secnames[SECNAME_MAX] = { }; -size_t -mdoc_isescape(const char *p) -{ - size_t c; - - if ('\\' != *p++) - return(0); - - switch (*p) { - case ('\\'): - /* FALLTHROUGH */ - case ('\''): - /* FALLTHROUGH */ - case ('`'): - /* FALLTHROUGH */ - case ('q'): - /* FALLTHROUGH */ - case ('-'): - /* FALLTHROUGH */ - case ('~'): - /* FALLTHROUGH */ - case ('^'): - /* FALLTHROUGH */ - case ('%'): - /* FALLTHROUGH */ - case ('0'): - /* FALLTHROUGH */ - case (' '): - /* FALLTHROUGH */ - case ('|'): - /* FALLTHROUGH */ - case ('&'): - /* FALLTHROUGH */ - case ('.'): - /* FALLTHROUGH */ - case (':'): - /* FALLTHROUGH */ - case ('e'): - return(2); - case ('*'): - if (0 == *++p || ! isgraph((u_char)*p)) - return(0); - switch (*p) { - case ('('): - if (0 == *++p || ! isgraph((u_char)*p)) - return(0); - return(4); - case ('['): - for (c = 3, p++; *p && ']' != *p; p++, c++) - if ( ! isgraph((u_char)*p)) - break; - return(*p == ']' ? c : 0); - default: - break; - } - return(3); - case ('('): - if (0 == *++p || ! isgraph((u_char)*p)) - return(0); - if (0 == *++p || ! isgraph((u_char)*p)) - return(0); - return(4); - case ('['): - break; - default: - return(0); - } - - for (c = 3, p++; *p && ']' != *p; p++, c++) - if ( ! isgraph((u_char)*p)) - break; - - return(*p == ']' ? c : 0); -} - - int mdoc_iscdelim(char p) { @@ -217,6 +140,7 @@ mdoc_atotime(const char *p) } +/* FIXME: move this into an editable .in file. */ size_t mdoc_macro2len(int macro) { -- cgit v1.2.3-59-g8ed1b