version 1.390, 2022/05/31 18:09:57 |
version 1.392, 2022/06/02 11:29:07 |
Line 1410 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
Line 1410 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
* it to backslashes and translate backslashes to \e. |
* it to backslashes and translate backslashes to \e. |
*/ |
*/ |
|
|
if (roff_escape(buf->buf, ln, pos, |
if (roff_escape(buf->buf, ln, pos, &iesc, &inam, |
&iesc, &iarg, &iendarg, &iend) != ESCAPE_EXPAND) { |
&iarg, &iendarg, &iend) != ESCAPE_EXPAND) { |
while (pos < iend) { |
while (pos < iend) { |
if (buf->buf[pos] == ec) { |
if (buf->buf[pos] == ec) { |
buf->buf[pos] = '\\'; |
buf->buf[pos] = '\\'; |
Line 1428 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
Line 1428 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
continue; |
continue; |
} |
} |
|
|
/* |
|
* Treat "\E" just like "\"; |
|
* it only makes a difference in copy mode. |
|
*/ |
|
|
|
inam = iesc + 1; |
|
while (buf->buf[inam] == 'E') |
|
inam++; |
|
|
|
/* Handle expansion. */ |
/* Handle expansion. */ |
|
|
res = NULL; |
res = NULL; |
Line 1520 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
Line 1511 roff_expand(struct roff *r, struct buf *buf, int ln, i |
|
*dst++ = '"'; |
*dst++ = '"'; |
} |
} |
continue; |
continue; |
|
case 'A': |
|
ubuf[0] = iendarg > iarg ? '1' : '0'; |
|
ubuf[1] = '\0'; |
|
res = ubuf; |
|
break; |
case 'B': |
case 'B': |
npos = 0; |
npos = 0; |
ubuf[0] = iendarg > iarg && iend > iendarg && |
ubuf[0] = iendarg > iarg && iend > iendarg && |