summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRay Imber <rayimber@gmail.com>2018-09-28 15:52:51 -0700
committerRay Imber <rayimber@gmail.com>2018-09-28 15:52:51 -0700
commit8e258d3e8af302585dd8d915f4f7aecd383d263d (patch)
treeadc67ce5010f03a9c7fcfbd338d36cf4e327d8d6
parent49291f3758ca27c69d9ae0bb162079ef6f86b5da (diff)
downloadNim-8e258d3e8af302585dd8d915f4f7aecd383d263d.tar.gz
Bugfix for fuzzysearch found by Zevv here: https://irclogs.nim-lang.org/28-09-2018.html#19:43:52
-rw-r--r--tools/dochack/fuzzysearch.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/dochack/fuzzysearch.nim b/tools/dochack/fuzzysearch.nim
index e6b1ea3cd..69f9fce3c 100644
--- a/tools/dochack/fuzzysearch.nim
+++ b/tools/dochack/fuzzysearch.nim
@@ -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])