summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_validate.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2009-06-19 00:07:06 +0000
committerschwarze <schwarze@openbsd.org>2009-06-19 00:07:06 +0000
commitb35ce0cd81216f9c29381c2f2d12c42dd7b27e62 (patch)
tree71bffb7b6a051275352f395a2f5581a70253ea8c /usr.bin/mandoc/mdoc_validate.c
parentsync to 1.7.19: comment cleanup; no functional change (diff)
downloadwireguard-openbsd-b35ce0cd81216f9c29381c2f2d12c42dd7b27e62.tar.xz
wireguard-openbsd-b35ce0cd81216f9c29381c2f2d12c42dd7b27e62.zip
sync to 1.7.19: escape sequences of the forms \*x and \*(xx are deprecated
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r--usr.bin/mandoc/mdoc_validate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index cf65b516a53..c4447ec44ab 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.7 2009/06/18 23:34:53 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.8 2009/06/19 00:07:06 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -53,6 +53,7 @@ enum mwarn {
WNOWIDTH,
WMISSWIDTH,
WESCAPE,
+ WDEPESC,
WDEPCOL,
WWRONGMSEC,
WSECOOO,
@@ -473,6 +474,9 @@ pwarn(struct mdoc *m, int line, int pos, enum mwarn type)
case (WESCAPE):
p = "invalid escape sequence";
break;
+ case (WDEPESC):
+ p = "deprecated special-character escape";
+ break;
case (WNOLINE):
p = "suggested no line arguments";
break;
@@ -712,8 +716,6 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
{
size_t c;
- /* FIXME: indicate deprecated escapes \*(xx and \*x. */
-
for ( ; *p; p++) {
if ('\t' == *p) {
if ( ! (MDOC_LITERAL & mdoc->flags))
@@ -728,6 +730,10 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
c = mdoc_isescape(p);
if (c) {
+ /* See if form is deprecated. */
+ if ('*' == p[1])
+ if ( ! pwarn(mdoc, line, pos, WDEPESC))
+ return(0);
p += (int)c - 1;
continue;
}