From 867f2974b364bb9866dc4f83b35ae281ce2b499d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 9 Jan 2017 02:21:37 +0000 Subject: merge rev. 1.154: improve message "whitespace at end of input line" --- read.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'read.c') 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 * Copyright (c) 2010-2016 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451