diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-28 18:09:01 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-28 18:09:01 +0000 |
commit | f65d8fa10a5663d103fcbcfb782054aac63efd23 (patch) | |
tree | edfb7eff7656cb754387a9a45043417bf3e4465c /mdoc_validate.c | |
parent | 376b2469fc1e1a7592a0cc6613fa7707fca855d0 (diff) | |
download | mandoc-f65d8fa10a5663d103fcbcfb782054aac63efd23.tar.gz mandoc-f65d8fa10a5663d103fcbcfb782054aac63efd23.tar.zst mandoc-f65d8fa10a5663d103fcbcfb782054aac63efd23.zip |
Drop useless architecture table. Validating architecture names
is a job for makewhatis(8)/mandoc.db(5), not for the parser.
Removes 150 lines from source files and 4k (1%) from the binary.
Bloat found by deraadt@.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 0b73eabd..72696041 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.260 2014/11/28 17:24:41 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.261 2014/11/28 18:09:01 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -2283,11 +2283,9 @@ post_dt(POST_ARGS) if (NULL == (nn = nn->next)) goto out; - /* Handles: `.Dt TITLE SEC VOL' - * title = TITLE, - * volume = VOL is vol ? format(VOL) : - * VOL is arch ? format(arch) : - * VOL + /* + * If the third argument is a volume name, format is, + * otherwise assume it's an architecture. */ cp = mdoc_a2vol(nn->string); @@ -2295,14 +2293,9 @@ post_dt(POST_ARGS) free(mdoc->meta.vol); mdoc->meta.vol = mandoc_strdup(cp); } else { - cp = mdoc_a2arch(nn->string); - if (NULL == cp) { - mandoc_vmsg(MANDOCERR_ARCH_BAD, mdoc->parse, - nn->line, nn->pos, "Dt ... %s", nn->string); - free(mdoc->meta.vol); - mdoc->meta.vol = mandoc_strdup(nn->string); - } else - mdoc->meta.arch = mandoc_strdup(cp); + for (p = nn->string; *p; p++) + *p = tolower((unsigned char)*p); + mdoc->meta.arch = mandoc_strdup(nn->string); } /* Ignore any subsequent parameters... */ |