X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/c93f1e0f2d3891330860de19b5ec3e274971a300..6719c1661f033ee6a197313c077e571a96ce1359:/manpath.c diff --git a/manpath.c b/manpath.c index 54f7a6b1..74f38a95 100644 --- a/manpath.c +++ b/manpath.c @@ -1,6 +1,6 @@ -/* $Id: manpath.c,v 1.35 2017/07/01 09:47:30 schwarze Exp $ */ +/* $Id: manpath.c,v 1.37 2018/11/22 11:30:23 schwarze Exp $ */ /* - * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze + * Copyright (c) 2011,2014,2015,2017,2018 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any @@ -232,8 +232,8 @@ int manconf_output(struct manoutput *conf, const char *cp, int fromfile) { const char *const toks[] = { - "includes", "man", "paper", "style", - "indent", "width", "fragment", "mdoc", "noval" + "includes", "man", "paper", "style", "indent", "width", + "tag", "fragment", "mdoc", "noval", "toc" }; const char *errstr; @@ -257,7 +257,7 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile) warnx("-O %s=?: Missing argument value", toks[tok]); return -1; } - if ((tok == 6 || tok == 7) && *cp != '\0') { + if (tok > 6 && *cp != '\0') { warnx("-O %s: Does not take a value: %s", toks[tok], cp); return -1; } @@ -312,14 +312,24 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile) warnx("-O width=%s is %s", cp, errstr); return -1; case 6: - conf->fragment = 1; + if (conf->tag != NULL) { + oldval = mandoc_strdup(conf->tag); + break; + } + conf->tag = mandoc_strdup(cp); return 0; case 7: - conf->mdoc = 1; + conf->fragment = 1; return 0; case 8: + conf->mdoc = 1; + return 0; + case 9: conf->noval = 1; return 0; + case 10: + conf->toc = 1; + return 0; default: if (fromfile) warnx("-O %s: Bad argument", cp);