diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-01-08 00:10:23 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-01-08 00:10:23 +0000 |
commit | 5db4097db6f4bf230e344c4dd10164352e979531 (patch) | |
tree | 39cf0215a10e409ae1490fd2b31f7b53443679bb /usr.bin/mandoc/mandoc.h | |
parent | 0f844d2e21c8aaefd64bdfbb4adee05bf5d3eaab (diff) |
Stricter validation of the NAME section, in particular:
- require a comma between names
- reject all other text nodes
- reject all empty Nm below NAME, not only in the leading position
- reject Nm after Nd
Diffstat (limited to 'usr.bin/mandoc/mandoc.h')
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index c0e1ff4ca2d..0ad279eb667 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,7 +1,7 @@ -/* $OpenBSD: mandoc.h,v 1.153 2016/12/28 17:21:17 schwarze Exp $ */ +/* $OpenBSD: mandoc.h,v 1.154 2017/01/08 00:10:22 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -65,10 +65,11 @@ enum mandocerr { MANDOCERR_DOC_EMPTY, /* no document body */ MANDOCERR_SEC_BEFORE, /* content before first section header: macro */ MANDOCERR_NAMESEC_FIRST, /* first section is not NAME: Sh title */ - MANDOCERR_NAMESEC_NONM, /* NAME section without name */ + MANDOCERR_NAMESEC_NONM, /* NAME section without Nm before Nd */ MANDOCERR_NAMESEC_NOND, /* NAME section without description */ MANDOCERR_NAMESEC_ND, /* description not at the end of NAME */ MANDOCERR_NAMESEC_BAD, /* bad NAME section content: macro */ + MANDOCERR_NAMESEC_PUNCT, /* missing comma before name: Nm name */ MANDOCERR_ND_EMPTY, /* missing description line, using "" */ MANDOCERR_SEC_ORDER, /* sections out of conventional order: Sh title */ MANDOCERR_SEC_REP, /* duplicate section title: Sh title */ |