aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/demandoc.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 /demandoc.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 'demandoc.c')
-rw-r--r--demandoc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/demandoc.c b/demandoc.c
index dc1781dc..e9aa62af 100644
--- a/demandoc.c
+++ b/demandoc.c
@@ -1,4 +1,4 @@
-/* $Id: demandoc.c,v 1.11 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: demandoc.c,v 1.12 2014/10/28 17:36:19 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -43,6 +43,7 @@ int
main(int argc, char *argv[])
{
struct mparse *mp;
+ struct mchars *mchars;
int ch, i, list;
extern int optind;
@@ -76,7 +77,8 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, NULL);
+ mchars = mchars_alloc();
+ mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, mchars, NULL);
assert(mp);
if (0 == argc)
@@ -88,6 +90,7 @@ main(int argc, char *argv[])
}
mparse_free(mp);
+ mchars_free(mchars);
return((int)MANDOCLEVEL_OK);
}