aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitd0ac87d04f62f2c8e644686b707cb2602c2ddba6 (patch)
tree69a250d8b0b0b75bc58e1c8af72b3c3269561aed /cgi.c
parent5fa1bace54f386a9b3ce23690f136232e1e5bb2e (diff)
downloadmandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.tar.gz
mandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.tar.zst
mandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.zip
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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cgi.c b/cgi.c
index 4cb4fa92..f09aaf67 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.99 2014/10/07 18:20:06 schwarze Exp $ */
+/* $Id: cgi.c,v 1.100 2014/10/28 17:36:19 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -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);
}