diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-09-18 22:37:06 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-09-18 22:37:06 +0000 |
commit | dd73c9cfdc1d81a6b2a64d654616ef955be79a3d (patch) | |
tree | 5bc54d22ea83ea07f61c50669a74ad2df7d455bb /usr.bin | |
parent | f683524df61b565fbcece73e6f6c40154bb8b069 (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')
-rw-r--r-- | usr.bin/mandoc/man.c | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 009a25ef413..ab25e160094 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.10 2009/08/22 23:17:39 schwarze Exp $ */ +/* $Id: man.c,v 1.11 2009/09/18 22:37:05 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -489,6 +489,12 @@ man_pmacro(struct man *m, int ln, char *buf) break; else if (' ' == buf[i]) break; + + /* Check for invalid characters. */ + + if (isgraph((u_char)buf[i])) + continue; + return(man_perr(m, ln, i, WNPRINT)); } mac[j] = 0; 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; |