Fixed issue in search engine (multiple identical matches returned when search query contained the same work multiple times).

This commit is contained in:
Dario Solera 2009-10-02 08:00:55 +00:00
parent 4bb5211191
commit e225f06bd1
6 changed files with 45 additions and 5 deletions

View file

@ -489,7 +489,8 @@ namespace ScrewTurn.Wiki {
len = sb.Length - start;
endsAtEnd = true;
}
else if(len > maxLen) len = maxLen;
if(len <= 0) len = sb.Length; // HACK: This should never occur, but if it does it crashes the wiki, so set it to max len
if(len > maxLen) len = maxLen;
result = sb.ToString();