diff options
author | Simon Krauter <trustablecode@gmail.com> | 2017-09-15 10:45:22 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-09-15 10:45:22 +0200 |
commit | 94e336fe850587f8c571c163bc9b567ecb491f82 (patch) | |
tree | a7924f4dcd34aab2cf2c9592300f2603766a21e9 /lib | |
parent | bca3bedc47145faa5ce83ad4fbf6f84d78da3ffa (diff) | |
download | Nim-94e336fe850587f8c571c163bc9b567ecb491f82.tar.gz |
Fix wrong result of countLines() (#6371)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/strutils.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 834e7db6a..2a64e70d9 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -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': |