Merge pull request #9112 from rayman22201/dockhack-fuzzy-match-bugfix

Bugfix for fuzzysearch found by Zevv
This commit is contained in:
Andreas Rumpf
2018-09-29 09:51:11 +02:00
committed by GitHub

View File

@@ -86,7 +86,7 @@ proc fuzzyMatch*(pattern, str: cstring) : tuple[score: int, matched: bool] =
score += ord(LeadingCharMatch)
var onBoundary = (patIndex == high(pattern))
if not onBoundary:
if not onBoundary and strIndex < high(str):
let
nextPatternChar = toLowerAscii(pattern[patIndex + 1])
nextStrChar = toLowerAscii(str[strIndex + 1])