summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-01-09 02:21:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-01-09 02:21:37 +0000
commitbe45f6c52abca93ab4e978f81e19018a10a19187 (patch)
tree9b90743739b164ef832481a3dcd655d87197fc73 /read.c
parent12a20fc23d9bf386966f3dcd1d43721030019b41 (diff)
downloadmandoc-be45f6c52abca93ab4e978f81e19018a10a19187.tar.gz
merge rev. 1.154: improve message "whitespace at end of input line"
Diffstat (limited to 'read.c')
-rw-r--r--read.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/read.c b/read.c
index 32d18634..620db279 100644
--- a/read.c
+++ b/read.c
@@ -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;