-/* $Id: roff.c,v 1.171 2011/09/19 08:34:45 schwarze Exp $ */
+/* $Id: roff.c,v 1.172 2011/10/24 21:41:45 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
int, int, const char *);
static enum rofft roff_parse(struct roff *, const char *, int *);
static enum rofferr roff_parsetext(char *);
-static void roff_res(struct roff *,
+static enum rofferr roff_res(struct roff *,
char **, size_t *, int, int);
static enum rofferr roff_rm(ROFF_ARGS);
static void roff_setstr(struct roff *,
* is processed.
* This also checks the syntax of regular escapes.
*/
-static void
+static enum rofferr
roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
{
enum mandoc_esc esc;
*/
if ('\0' == *cp)
- return;
+ return(ROFF_CONT);
if ('*' != *cp) {
res = cp;
mandoc_msg
(MANDOCERR_BADESCAPE, r->parse,
ln, (int)(stesc - *bufp), NULL);
- return;
+ return(ROFF_CONT);
}
cp++;
switch (*cp) {
case ('\0'):
- return;
+ return(ROFF_CONT);
case ('('):
cp++;
maxl = 2;
(MANDOCERR_BADESCAPE,
r->parse, ln,
(int)(stesc - *bufp), NULL);
- return;
+ return(ROFF_CONT);
}
if (0 == maxl && ']' == *cp)
break;
/* Just leave the string unexpanded. */
mandoc_msg(MANDOCERR_ROFFLOOP, r->parse, ln, pos, NULL);
- return;
+ return(ROFF_IGN);
}
+ return(ROFF_CONT);
}
/*
* words to fill in.
*/
- roff_res(r, bufp, szp, ln, pos);
+ e = roff_res(r, bufp, szp, ln, pos);
+ if (ROFF_IGN == e)
+ return(e);
+ assert(ROFF_CONT == e);
ppos = pos;
ctl = mandoc_getcontrol(*bufp, &pos);