version 1.212, 2014/06/29 22:14:10 |
version 1.213, 2014/06/29 22:38:47 |
Line 910 roff_ccond(struct roff *r, int ln, int ppos) |
|
Line 910 roff_ccond(struct roff *r, int ln, int ppos) |
|
static enum rofferr |
static enum rofferr |
roff_block(ROFF_ARGS) |
roff_block(ROFF_ARGS) |
{ |
{ |
int sv; |
char *name, *cp; |
size_t sz; |
size_t namesz; |
char *name; |
|
|
|
name = NULL; |
name = cp = *bufp + pos; |
|
namesz = 0; |
|
|
if (ROFF_ig != tok) { |
if (ROFF_ig != tok) { |
if ('\0' == (*bufp)[pos]) { |
if ('\0' == *cp) { |
mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); |
mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); |
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
Line 929 roff_block(ROFF_ARGS) |
|
Line 929 roff_block(ROFF_ARGS) |
|
|
|
if (ROFF_de1 == tok) |
if (ROFF_de1 == tok) |
tok = ROFF_de; |
tok = ROFF_de; |
if (ROFF_de == tok) |
else if (ROFF_de != tok) |
name = *bufp + pos; |
|
else |
|
mandoc_msg(MANDOCERR_REQUEST, r->parse, ln, ppos, |
mandoc_msg(MANDOCERR_REQUEST, r->parse, ln, ppos, |
roffs[tok].name); |
roffs[tok].name); |
|
|
while ((*bufp)[pos] && ! isspace((unsigned char)(*bufp)[pos])) |
namesz = roff_getname(r, &cp, ln, ppos); |
pos++; |
name[namesz] = '\0'; |
|
} else |
|
name = NULL; |
|
|
while (isspace((unsigned char)(*bufp)[pos])) |
|
(*bufp)[pos++] = '\0'; |
|
} |
|
|
|
roffnode_push(r, tok, name, ln, ppos); |
roffnode_push(r, tok, name, ln, ppos); |
|
|
/* |
/* |
Line 950 roff_block(ROFF_ARGS) |
|
Line 946 roff_block(ROFF_ARGS) |
|
* appended from roff_block_text() in multiline mode. |
* appended from roff_block_text() in multiline mode. |
*/ |
*/ |
|
|
if (ROFF_de == tok) |
if (namesz && ROFF_de == tok) |
roff_setstr(r, name, "", 0); |
roff_setstrn(&r->strtab, name, namesz, "", 0, 0); |
|
|
if ('\0' == (*bufp)[pos]) |
if ('\0' == *cp) |
return(ROFF_IGN); |
return(ROFF_IGN); |
|
|
/* If present, process the custom end-of-line marker. */ |
/* If present, process the custom end-of-line marker. */ |
|
|
sv = pos; |
name = cp; |
while ((*bufp)[pos] && ! isspace((unsigned char)(*bufp)[pos])) |
namesz = roff_getname(r, &cp, ln, ppos); |
pos++; |
if (namesz) |
|
r->last->end = mandoc_strndup(name, namesz); |
|
|
/* |
if ('\0' != *cp) |
* Note: groff does NOT like escape characters in the input. |
|
* Instead of detecting this, we're just going to let it fly and |
|
* to hell with it. |
|
*/ |
|
|
|
assert(pos > sv); |
|
sz = (size_t)(pos - sv); |
|
|
|
if (1 == sz && '.' == (*bufp)[sv]) |
|
return(ROFF_IGN); |
|
|
|
r->last->end = mandoc_malloc(sz + 1); |
|
|
|
memcpy(r->last->end, *bufp + sv, sz); |
|
r->last->end[(int)sz] = '\0'; |
|
|
|
if ((*bufp)[pos]) |
|
mandoc_msg(MANDOCERR_ARGSLOST, r->parse, ln, pos, NULL); |
mandoc_msg(MANDOCERR_ARGSLOST, r->parse, ln, pos, NULL); |
|
|
return(ROFF_IGN); |
return(ROFF_IGN); |