fixes a critical strutils bug [backport]
This commit is contained in:
parent
1a771a8248
commit
68ce92d4eb
1 changed files with 1 additions and 1 deletions
|
|
@ -377,7 +377,7 @@ proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
||||||
proc substrEq(s: string, pos: int, substr: string): bool =
|
proc substrEq(s: string, pos: int, substr: string): bool =
|
||||||
var i = 0
|
var i = 0
|
||||||
var length = substr.len
|
var length = substr.len
|
||||||
while i < length and s[pos+i] == substr[i]:
|
while i < length and pos+i < s.len and s[pos+i] == substr[i]:
|
||||||
inc i
|
inc i
|
||||||
return i == length
|
return i == length
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue