Commit 1705a01
Guard parseFileAndRemoveComments against a comment before the first newline
rfind('\n') returns npos when a comment marker is on the first line, and
erase(npos, ...) throws std::out_of_range. Treat firstNL==npos as "erase
from position 0" and secondNL==npos (comment on the last line, no
trailing newline) as "erase to end".
Fixes #133
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 48f83e5 commit 1705a01
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
393 | 397 | | |
394 | 398 | | |
395 | 399 | | |
| |||
0 commit comments