summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-09-18 22:37:06 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-09-18 22:37:06 +0000
commitdd73c9cfdc1d81a6b2a64d654616ef955be79a3d (patch)
tree5bc54d22ea83ea07f61c50669a74ad2df7d455bb /usr.bin/mandoc/mdoc.c
parentf683524df61b565fbcece73e6f6c40154bb8b069 (diff)
sync to 1.9.2: non-printable characters in macro names are errors;
from joerg at netbsd dot org
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 803e8143aaf..da3983aca93 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.25 2009/08/22 21:55:06 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.26 2009/09/18 22:37:05 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -705,6 +705,12 @@ parsemacro(struct mdoc *m, int ln, char *buf)
break;
else if (' ' == buf[i])
break;
+
+ /* Check for invalid characters. */
+
+ if (isgraph((u_char)buf[i]))
+ continue;
+ return(mdoc_perr(m, ln, i, EPRINT));
}
mac[j] = 0;