Fixed prefix results when the prefix matches a word.
--- a/src/jdict/DictIndex.java Sun Jul 29 21:24:34 2007 +0200
+++ b/src/jdict/DictIndex.java Sun Jul 29 21:26:49 2007 +0200
@@ -398,14 +398,18 @@
}
} while (step > 0);
- /* Replace pivot for prefixes */
- try {
- in.seekFromStart(pivot);
- } catch (IOException e)
+ /* If we didn't find a word, replace the pivot */
+ if (results.size() == 0)
{
- System.out.println("Seek from start error");
- return results;
+ try {
+ in.seekFromStart(pivot);
+ } catch (IOException e)
+ {
+ System.out.println("Seek from start error");
+ return results;
+ }
}
+
readUntilNewLine();
/* Add the prefixes */