7bff3069c42ac54b6f3f90b35511575952cd0184
larrym
  Wed Oct 20 13:57:56 2010 -0700
fix problem in findOrderedSpan; it was returning span - 1 in cases where an item had a span with all words and then some, but not all, of the words after the span (this caused problem in track search)
diff --git src/lib/trix.c src/lib/trix.c
index 8f0e5dd..109c0cd 100644
--- src/lib/trix.c
+++ src/lib/trix.c
@@ -560,7 +560,7 @@
 /* Find out smallest number of words in doc that will cover
  * all words in search. */
 {
-int minSpan = BIGNUM;
+int minSpan = BIGNUM - 1;  // subtract 1 to accomodate adding 1 below
 struct trixWordResult *twr;
 
 /* Set up iHit pointers we use to keep track of our 
@@ -582,7 +582,7 @@
 	for (hit = twr->iHit; ; hit = hit->next)
 	    {
 	    if (hit == NULL || !sameString(hit->itemId, itemId))
-	        return minSpan;
+	        return minSpan + 1;
 	    if (hit->wordIx > endWord)
 	        break;
 	    }