From 6b618405d781b6a4a5425bf52419f31f0362fcf1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 15 Jan 2015 04:26:39 +0000 Subject: 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. --- main.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 5bd99a53..a79523bf 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.214 2015/01/14 21:27:17 schwarze Exp $ */ +/* $Id: main.c,v 1.215 2015/01/15 04:26:39 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -176,7 +176,7 @@ main(int argc, char *argv[]) memset(&curp, 0, sizeof(struct curparse)); curp.outtype = OUTT_LOCALE; - curp.wlevel = MANDOCLEVEL_FATAL; + curp.wlevel = MANDOCLEVEL_BADARG; options = MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1; defos = NULL; @@ -647,11 +647,6 @@ parse(struct curparse *curp, int fd, const char *file, rc = mparse_readfd(curp->mp, fd, file); - /* Stop immediately if the parse has failed. */ - - if (MANDOCLEVEL_FATAL <= rc) - goto cleanup; - /* * With -Wstop and warnings or errors of at least the requested * level, do not produce output. @@ -913,7 +908,7 @@ woptions(struct curparse *curp, char *arg) curp->wlevel = MANDOCLEVEL_ERROR; break; case 4: - curp->wlevel = MANDOCLEVEL_FATAL; + curp->wlevel = MANDOCLEVEL_BADARG; break; default: fprintf(stderr, "%s: -W %s: Bad argument\n", -- cgit v1.2.3-56-ge451