Commit fc2e62b
committed
Prevent accidental discard of line content during file.readLines
file.readLines reads chunks of 1024 bytes, looking for newline characters. If we have content at the end of a chunk that isn't a newline, we store that content in a variable called `partialLine`.
However, if an entire chunk goes by without a newline (say, there's a line with >1024 characters), then ideally, we should append the chunk to the stored `partialLine`. However, we were instead *replacing* `partialLine` with the new chunk, accidentally discarding whatever was in `partialLine` before. It's an easy bug to miss, and simply swapping `partialLine =` with `partialLine +=` fixes the issue perfectly.
Fixes #190.1 parent d1f2fcb commit fc2e62b
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| |||
0 commit comments