Fix wrong result of countLines() (#6371)

This commit is contained in:
Simon Krauter 2017-09-15 10:45:22 +02:00 • committed by Andreas Rumpf
commit 94e336fe85
2 changed files with 14 additions and 1 deletions

View file

@ -776,7 +776,8 @@ proc countLines*(s: string): int {.noSideEffect,
##
## In this context, a line is any string seperated by a newline combination.
## A line can be an empty string.
var i = 1
result = 1
var i = 0
while i < s.len:
case s[i]
of '\c':