From f65d8fa10a5663d103fcbcfb782054aac63efd23 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 28 Nov 2014 18:09:01 +0000 Subject: 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@. --- mdoc_validate.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'mdoc_validate.c') 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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... */ -- cgit v1.2.3