From d0ac87d04f62f2c8e644686b707cb2602c2ddba6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 28 Oct 2014 17:36:19 +0000 Subject: 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. --- read.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index 67e6a838..6c558817 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.93 2014/10/25 01:03:52 schwarze Exp $ */ +/* $Id: read.c,v 1.94 2014/10/28 17:36:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -51,6 +51,7 @@ struct mparse { struct man *man; /* man parser */ struct mdoc *mdoc; /* mdoc parser */ struct roff *roff; /* roff parser (!NULL) */ + const struct mchars *mchars; /* character table */ char *sodest; /* filename pointed to by .so */ const char *file; /* filename of current input file */ struct buf *primary; /* buffer currently being parsed */ @@ -914,8 +915,8 @@ mparse_wait(struct mparse *curp, pid_t child_pid) } struct mparse * -mparse_alloc(int options, enum mandoclevel wlevel, - mandocmsg mmsg, const char *defos) +mparse_alloc(int options, enum mandoclevel wlevel, mandocmsg mmsg, + const struct mchars *mchars, const char *defos) { struct mparse *curp; @@ -928,7 +929,8 @@ mparse_alloc(int options, enum mandoclevel wlevel, curp->mmsg = mmsg; curp->defos = defos; - curp->roff = roff_alloc(curp, options); + curp->mchars = mchars; + curp->roff = roff_alloc(curp, curp->mchars, options); if (curp->options & MPARSE_MDOC) curp->pmdoc = mdoc_alloc( curp->roff, curp, curp->defos, -- cgit v1.2.3-56-ge451