diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-01-09 02:21:37 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-01-09 02:21:37 +0000 |
commit | be45f6c52abca93ab4e978f81e19018a10a19187 (patch) | |
tree | 9b90743739b164ef832481a3dcd655d87197fc73 /read.c | |
parent | 12a20fc23d9bf386966f3dcd1d43721030019b41 (diff) | |
download | mandoc-be45f6c52abca93ab4e978f81e19018a10a19187.tar.gz |
merge rev. 1.154: improve message "whitespace at end of input line"
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -317,6 +317,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) const char *save_file; char *cp; size_t pos; /* byte number in the ln buffer */ + size_t j; /* auxiliary byte number in the blk buffer */ enum rofferr rr; int of; int lnn; /* line number in the real file */ @@ -422,6 +423,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) } if ('"' == blk.buf[i + 1] || '#' == blk.buf[i + 1]) { + j = i; i += 2; /* Comment, skip to end of line */ for (; i < blk.sz; ++i) { @@ -432,7 +434,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) mandoc_msg( MANDOCERR_SPACE_EOL, curp, curp->line, - pos, NULL); + pos + i-1 - j, NULL); ++i; ++lnn; break; |