diff options
author | 2015-01-15 04:26:39 +0000 | |
---|---|---|
committer | 2015-01-15 04:26:39 +0000 | |
commit | 6b618405d781b6a4a5425bf52419f31f0362fcf1 (patch) | |
tree | d28f1821e50247b93cfa8e53a1db6db3e51a969b /mandocdb.c | |
parent | 8b5853de9633ceece63738b2ccd5bdba06098315 (diff) | |
download | mandoc-6b618405d781b6a4a5425bf52419f31f0362fcf1.tar.gz mandoc-6b618405d781b6a4a5425bf52419f31f0362fcf1.tar.zst mandoc-6b618405d781b6a4a5425bf52419f31f0362fcf1.zip |
Fatal errors no longer exist.
If a file can be opened, mandoc will produce some output;
at worst, the output may be almost empty.
Simplifies error handling and frees a message type for future use.
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.182 2015/01/03 12:55:25 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.183 2015/01/15 04:26:40 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -442,7 +442,7 @@ mandocdb(int argc, char *argv[]) exitcode = (int)MANDOCLEVEL_OK; mchars = mchars_alloc(); - mp = mparse_alloc(mparse_options, MANDOCLEVEL_FATAL, NULL, + mp = mparse_alloc(mparse_options, MANDOCLEVEL_BADARG, NULL, mchars, NULL); ohash_init(&mpages, 6, &mpages_info); ohash_init(&mlinks, 6, &mlinks_info); @@ -1102,7 +1102,6 @@ mpages_merge(struct mparse *mp) char *cp; int fd; unsigned int pslot; - enum mandoclevel lvl; str_info.alloc = hash_alloc; str_info.calloc = hash_calloc; @@ -1136,14 +1135,12 @@ mpages_merge(struct mparse *mp) } /* - * Try interpreting the file as mdoc(7) or man(7) - * source code, unless it is already known to be - * formatted. Fall back to formatted mode. + * Interpret the file as mdoc(7) or man(7) source + * code, unless it is known to be formatted. */ if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { - lvl = mparse_readfd(mp, fd, mlink->file); - if (lvl < MANDOCLEVEL_FATAL) - mparse_result(mp, &mdoc, &man, &sodest); + mparse_readfd(mp, fd, mlink->file); + mparse_result(mp, &mdoc, &man, &sodest); } if (sodest != NULL) { |