version 1.26, 2011/11/07 01:24:40 |
version 1.27, 2012/02/05 16:46:15 |
Line 325 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
Line 325 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
* Warn about bogus characters. If you're using |
* Warn about bogus characters. If you're using |
* non-ASCII encoding, you're screwing your |
* non-ASCII encoding, you're screwing your |
* readers. Since I'd rather this not happen, |
* readers. Since I'd rather this not happen, |
* I'll be helpful and drop these characters so |
* I'll be helpful and replace these characters |
* we don't display gibberish. Note to manual |
* with "?", so we don't display gibberish. |
* writers: use special characters. |
* Note to manual writers: use special characters. |
*/ |
*/ |
|
|
c = (unsigned char) blk.buf[i]; |
c = (unsigned char) blk.buf[i]; |
Line 335 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
Line 335 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
if ( ! (isascii(c) && |
if ( ! (isascii(c) && |
(isgraph(c) || isblank(c)))) { |
(isgraph(c) || isblank(c)))) { |
mandoc_msg(MANDOCERR_BADCHAR, curp, |
mandoc_msg(MANDOCERR_BADCHAR, curp, |
curp->line, pos, "ignoring byte"); |
curp->line, pos, NULL); |
i++; |
i++; |
|
if (pos >= (int)ln.sz) |
|
resize_buf(&ln, 256); |
|
ln.buf[pos++] = '?'; |
continue; |
continue; |
} |
} |
|
|