diff options
Diffstat (limited to 'src/errmsg.cpp')
| -rw-r--r-- | src/errmsg.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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; |
