From b6f5a4920d2068f6124a4827a8acddda416a27fc Mon Sep 17 00:00:00 2001 From: John Foerch Date: Sat, 14 Nov 2009 23:06:55 -0500 Subject: [PATCH] casual_spelling_hints_text_match: fix error --- modules/casual-spelling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/casual-spelling.js b/modules/casual-spelling.js index b1ea56d..a2bea86 100644 --- a/modules/casual-spelling.js +++ b/modules/casual-spelling.js @@ -91,8 +91,8 @@ function casual_spelling_hints_text_match (text, pattern) { if (pattern == "") return [0, 0]; var plen = pattern.length; - for (var i = 0, tlen = text.length - plen; i < tlen; i++) { - for (var j = 0; j < plen; j++) { + for (var i = 0, tlen = text.length - plen; i <= tlen; i++) { + for (var j = 0;; j++) { if (pattern[j] != text[i+j] && pattern[j] != casual_spelling_translate(text[i+j])) break; -- 2.11.4.GIT