diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-09-05 00:21:02 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-09-05 00:21:02 -0400 |
| commit | cc621cdee3da956e0976e656d4d310fcad441dad (patch) | |
| tree | 9c1e5b68b205ba67db9f0548d652d0858795010f /src/errmsg.cpp | |
| parent | e1d5da20a5d5e54b9dba6031c97fe232192e69cd (diff) | |
| download | zig-cc621cdee3da956e0976e656d4d310fcad441dad.tar.gz zig-cc621cdee3da956e0976e656d4d310fcad441dad.zip | |
fix parseh bugs
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; |
