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 | e648fcd63ca4a6932755144a7cfaad0a3f55cffa (patch) | |
tree | c86fb8551e74850f832dfa752bb4dd665a1ea9aa /mdoc_validate.c | |
parent | 51f9cec4efd7d8933b59dad631602cf4d70bdc0d (diff) | |
download | mandoc-e648fcd63ca4a6932755144a7cfaad0a3f55cffa.tar.gz |
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 | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 4692edab..adba1204 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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... */ |