summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-15 04:26:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-15 04:26:39 +0000
commit581eba212eeec68331e4aa4a904d7c2d72bac114 (patch)
treed24a62288413bfb95754a300f45747756dc9943e /mandocdb.c
parent23a511d07a0f2e04178f507d768c9e5e7e86f858 (diff)
downloadmandoc-581eba212eeec68331e4aa4a904d7c2d72bac114.tar.gz
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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mandocdb.c b/mandocdb.c
index b692007f..dd5fa488 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -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) {