aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit867f2974b364bb9866dc4f83b35ae281ce2b499d (patch)
tree2cac7742bb598eef38f7b827dd11e99e1a64f722
parent405c0ea679dfd7bb93deda4396cc5a8a3b7a9db6 (diff)
downloadmandoc-867f2974b364bb9866dc4f83b35ae281ce2b499d.tar.gz
mandoc-867f2974b364bb9866dc4f83b35ae281ce2b499d.tar.zst
mandoc-867f2974b364bb9866dc4f83b35ae281ce2b499d.zip
merge rev. 1.154: improve message "whitespace at end of input line"
-rw-r--r--read.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/read.c b/read.c
index 678e6f9b..39da66cd 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.150.2.2 2016/11/10 12:52:12 schwarze Exp $ */
+/* $Id: read.c,v 1.150.2.3 2017/01/09 02:21:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;