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
commit f6e9af28db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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