From cc621cdee3da956e0976e656d4d310fcad441dad Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 5 Sep 2017 00:21:02 -0400 Subject: fix parseh bugs --- src/errmsg.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/errmsg.cpp') diff --git a/src/errmsg.cpp b/src/errmsg.cpp index ef61d09740..91a12fda4e 100644 --- a/src/errmsg.cpp +++ b/src/errmsg.cpp @@ -79,11 +79,14 @@ ErrorMsg *err_msg_create_with_offset(Buf *path, size_t line, size_t column, size for (;;) { if (line_start_offset == 0) { break; - } else if (source[line_start_offset] == '\n') { + } + + line_start_offset -= 1; + + if (source[line_start_offset] == '\n') { line_start_offset += 1; break; } - line_start_offset -= 1; } size_t line_end_offset = offset; -- cgit v1.2.3