=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.187 retrieving revision 1.190 diff -u -p -r1.187 -r1.190 --- mandoc/roff.c 2013/12/15 21:23:52 1.187 +++ mandoc/roff.c 2014/01/06 21:34:31 1.190 @@ -1,7 +1,7 @@ -/* $Id: roff.c,v 1.187 2013/12/15 21:23:52 schwarze Exp $ */ +/* $Id: roff.c,v 1.190 2014/01/06 21:34:31 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze + * Copyright (c) 2010-2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -109,6 +109,7 @@ struct roffreg { struct roff { enum mparset parsetype; /* requested parse type */ struct mparse *parse; /* parse point */ + int quick; /* skip standard macro deletion */ struct roffnode *last; /* leaf of stack */ enum roffrule rstack[RSTACK_MAX]; /* stack of !`ie' rules */ char control; /* control character */ @@ -468,7 +469,7 @@ roff_free(struct roff *r) struct roff * -roff_alloc(enum mparset type, struct mparse *parse) +roff_alloc(enum mparset type, struct mparse *parse, int quick) { struct roff *r; int i; @@ -476,6 +477,7 @@ roff_alloc(enum mparset type, struct mparse *parse) r = mandoc_calloc(1, sizeof(struct roff)); r->parsetype = type; r->parse = parse; + r->quick = quick; r->rstackpos = -1; roffhash_init(); @@ -646,8 +648,7 @@ roff_parsetext(char **bufp, size_t *szp, int pos, int if ('\\' == *p) { /* Skip over escapes. */ p++; - esc = mandoc_escape - ((const char const **)&p, NULL, NULL); + esc = mandoc_escape((const char **)&p, NULL, NULL); if (ESCAPE_ERROR == esc) break; continue; @@ -1498,7 +1499,7 @@ roff_Dd(ROFF_ARGS) { const char *const *cp; - if (MPARSE_MDOC != r->parsetype) + if (0 == r->quick && MPARSE_MDOC != r->parsetype) for (cp = __mdoc_reserved; *cp; cp++) roff_setstr(r, *cp, NULL, 0); @@ -1511,7 +1512,7 @@ roff_TH(ROFF_ARGS) { const char *const *cp; - if (MPARSE_MDOC != r->parsetype) + if (0 == r->quick && MPARSE_MDOC != r->parsetype) for (cp = __man_reserved; *cp; cp++) roff_setstr(r, *cp, NULL, 0); @@ -1733,7 +1734,7 @@ roff_userdef(ROFF_ARGS) /* * Collect pointers to macro argument strings - * and null-terminate them. + * and NUL-terminate them. */ cp = *bufp + pos; for (i = 0; i < 9; i++)