do roff nr expansion before trailing backslash

This commit is contained in:
christos 2013-04-03 00:55:32 +00:00
parent d347f34bdd
commit 897a7bb8a0
1 changed files with 7 additions and 7 deletions

View File

@ -344,20 +344,20 @@ mparse_buf_r(struct mparse *curp, struct buf blk, int start)
continue;
}
/* Trailing backslash = a plain char. */
/* Expand registers inline */
if ('\\' == blk.buf[i] && 'n' == blk.buf[i + 1]) {
roff_expand_nr(curp->roff,
blk.buf, &i, blk.sz, &ln.buf, &pos, &ln.sz);
continue;
}
/* Trailing backslash = a plain char. */
if ('\\' != blk.buf[i] || i + 1 == (int)blk.sz) {
if (pos >= (int)ln.sz)
resize_buf(&ln, 256);
ln.buf[pos++] = blk.buf[i++];
continue;
}
if ('\\' == blk.buf[i] && 'n' == blk.buf[i + 1]) {
roff_expand_nr(curp->roff,
blk.buf, &i, blk.sz, &ln.buf, &pos, &ln.sz);
}
/*
* Found escape and at least one other character.
* When it's a newline character, skip it.