version 1.141, 2011/05/24 21:18:06 |
version 1.142, 2011/05/26 11:58:25 |
Line 150 static const char *roff_getstrn(const struct roff *, |
|
Line 150 static const char *roff_getstrn(const struct roff *, |
|
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
static int roff_res(struct roff *, |
static int roff_res(struct roff *, |
char **, size_t *, int); |
char **, size_t *, int, int); |
static enum rofferr roff_rm(ROFF_ARGS); |
static enum rofferr roff_rm(ROFF_ARGS); |
static void roff_setstr(struct roff *, |
static void roff_setstr(struct roff *, |
const char *, const char *, int); |
const char *, const char *, int); |
Line 387 roff_alloc(struct regset *regs, struct mparse *parse) |
|
Line 387 roff_alloc(struct regset *regs, struct mparse *parse) |
|
* is processed. |
* is processed. |
*/ |
*/ |
static int |
static int |
roff_res(struct roff *r, char **bufp, size_t *szp, int pos) |
roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos) |
{ |
{ |
const char *stesc; /* start of an escape sequence ('\\') */ |
const char *stesc; /* start of an escape sequence ('\\') */ |
const char *stnam; /* start of the name, after "[(*" */ |
const char *stnam; /* start of the name, after "[(*" */ |
Line 454 roff_res(struct roff *r, char **bufp, size_t *szp, int |
|
Line 454 roff_res(struct roff *r, char **bufp, size_t *szp, int |
|
res = roff_getstrn(r, stnam, (size_t)i); |
res = roff_getstrn(r, stnam, (size_t)i); |
|
|
if (NULL == res) { |
if (NULL == res) { |
cp -= maxl ? 1 : 0; |
/* TODO: keep track of the correct position. */ |
continue; |
mandoc_msg(MANDOCERR_BADESCAPE, r->parse, ln, pos, NULL); |
|
res = ""; |
} |
} |
|
|
/* Replace the escape sequence by the string. */ |
/* Replace the escape sequence by the string. */ |
Line 491 roff_parseln(struct roff *r, int ln, char **bufp, |
|
Line 492 roff_parseln(struct roff *r, int ln, char **bufp, |
|
* words to fill in. |
* words to fill in. |
*/ |
*/ |
|
|
if (r->first_string && ! roff_res(r, bufp, szp, pos)) |
if (r->first_string && ! roff_res(r, bufp, szp, ln, pos)) |
return(ROFF_REPARSE); |
return(ROFF_REPARSE); |
|
|
ppos = pos; |
ppos = pos; |