summaryrefslogtreecommitdiffstats
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-28 17:36:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-28 17:36:19 +0000
commite140259c6ca1889b0dddef8b075524723b147cfe (patch)
tree351a20004d594caa3735ca29afb581ace2b8ea76 /cgi.c
parent9a3f7e6d544fc2f5c114c480cb724e44cfac1ea9 (diff)
downloadmandoc-e140259c6ca1889b0dddef8b075524723b147cfe.tar.gz
Make the character table available to libroff so it can check the
validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
Diffstat (limited to 'cgi.c')
-rw-r--r--cgi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cgi.c b/cgi.c
index 1145a150..c42abdca 100644
--- a/cgi.c
+++ b/cgi.c
@@ -824,6 +824,7 @@ static void
format(const struct req *req, const char *file)
{
struct mparse *mp;
+ struct mchars *mchars;
struct mdoc *mdoc;
struct man *man;
void *vp;
@@ -837,8 +838,9 @@ format(const struct req *req, const char *file)
return;
}
+ mchars = mchars_alloc();
mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL,
- req->q.manpath);
+ mchars, req->q.manpath);
rc = mparse_readfd(mp, fd, file);
close(fd);
@@ -864,10 +866,11 @@ format(const struct req *req, const char *file)
req->q.manpath, file);
pg_error_internal();
mparse_free(mp);
+ mchars_free(mchars);
return;
}
- vp = html_alloc(opts);
+ vp = html_alloc(mchars, opts);
if (NULL != mdoc)
html_mdoc(vp, mdoc);
@@ -876,6 +879,7 @@ format(const struct req *req, const char *file)
html_free(vp);
mparse_free(mp);
+ mchars_free(mchars);
free(opts);
}