diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-15 04:26:39 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-15 04:26:39 +0000 |
commit | 6b618405d781b6a4a5425bf52419f31f0362fcf1 (patch) | |
tree | d28f1821e50247b93cfa8e53a1db6db3e51a969b /cgi.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 'cgi.c')
-rw-r--r-- | cgi.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.102 2014/11/26 17:55:27 schwarze Exp $ */ +/* $Id: cgi.c,v 1.103 2015/01/15 04:26:39 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de> @@ -822,7 +822,6 @@ format(const struct req *req, const char *file) struct man *man; void *vp; char *opts; - enum mandoclevel rc; int fd; int usepath; @@ -832,18 +831,11 @@ format(const struct req *req, const char *file) } mchars = mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, + mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, mchars, req->q.manpath); - rc = mparse_readfd(mp, fd, file); + mparse_readfd(mp, fd, file); close(fd); - if (rc >= MANDOCLEVEL_FATAL) { - fprintf(stderr, "fatal mandoc error: %s/%s\n", - req->q.manpath, file); - pg_error_internal(); - return; - } - usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&opts, "fragment,man=%s?query=%%N&sec=%%S%s%s%s%s", |