version 1.195, 2014/03/07 02:22:05 |
version 1.197, 2014/03/07 18:37:37 |
Line 1070 roff_cond_sub(ROFF_ARGS) |
|
Line 1070 roff_cond_sub(ROFF_ARGS) |
|
ln, ppos, pos, offs)); |
ln, ppos, pos, offs)); |
} |
} |
|
|
/* Always check for the closing delimiter `\}'. */ |
/* |
|
* If `\}' occurs on a macro line without a preceding macro, |
|
* drop the line completely. |
|
*/ |
|
|
ep = &(*bufp)[pos]; |
ep = *bufp + pos; |
while (NULL != (ep = strchr(ep, '\\'))) { |
if ('\\' == ep[0] && '}' == ep[1]) |
if ('}' != *(++ep)) |
rr = ROFFRULE_DENY; |
continue; |
|
|
|
/* |
/* Always check for the closing delimiter `\}'. */ |
* If we're at the end of line, then just chop |
|
* off the \} and resize the buffer. |
|
* If we aren't, then convert it to spaces. |
|
*/ |
|
|
|
if ('\0' == *(ep + 1)) { |
while (NULL != (ep = strchr(ep, '\\'))) { |
*--ep = '\0'; |
if ('}' == *(++ep)) { |
*szp -= 2; |
*ep = '&'; |
} else |
roff_ccond(r, ln, ep - *bufp - 1); |
*(ep - 1) = *ep = ' '; |
} |
|
++ep; |
roff_ccond(r, ln, pos); |
|
} |
} |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
} |
} |
Line 1104 roff_cond_text(ROFF_ARGS) |
|
Line 1101 roff_cond_text(ROFF_ARGS) |
|
rr = r->last->rule; |
rr = r->last->rule; |
roffnode_cleanscope(r); |
roffnode_cleanscope(r); |
|
|
ep = &(*bufp)[pos]; |
ep = *bufp + pos; |
for ( ; NULL != (ep = strchr(ep, '\\')); ep++) { |
while (NULL != (ep = strchr(ep, '\\'))) { |
ep++; |
if ('}' == *(++ep)) { |
if ('}' != *ep) |
*ep = '&'; |
continue; |
roff_ccond(r, ln, ep - *bufp - 1); |
*ep = '&'; |
} |
roff_ccond(r, ln, pos); |
++ep; |
} |
} |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
} |
} |