
From hans-peter.nilsson@axis.com Mon Jan 11 12:29:26 1999
Date: Sun, 10 Jan 1999 21:41:45 +0100
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: htdig@sdsu.edu
Subject: htdig: Patch for htsearch.cc, fixes "or or".

If "and" is badworded (as default) but "or" isn't (should be no
need to, as it is less than minimum_word_length), then if your
search is "boolean", you will get "dog or or cat" in the
$(WORDS) variable (as in the default string to search for next)
on the resulting page.

Maybe badWords.IsValid() should not have returned true for "or", as it
does not meet the minimum_word_length, but if so, that's another bug.

Sun Jan 10 20:53:22 1999  Hans-Peter Nilsson  <hp@axis.se>

	* htsearch/htsearch.cc (setupWords): Do not test and insert
	boolean words if word is already valid.

Index: htsearch.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htsearch/htsearch.cc,v
retrieving revision 1.18
diff -p -c -r1.18 htsearch.cc
*** htsearch.cc	1998/12/19 16:55:11	1.18
--- htsearch.cc	1999/01/10 20:00:28
*************** setupWords(char *allWords, List &searchW
*** 419,428 ****
  	}
  	if (badWords.IsValid(p))
  	    parsedWords << p << ' ';
! 	if (boolean && ((mystrncasecmp(p, "or", 2) == 0) || 
! 			(mystrncasecmp(p, "and", 3) == 0) ||
! 			(mystrncasecmp(p, "not", 3) == 0)))
  	    parsedWords << p << ' ';
      }
  
      parsedWords.chop(' ');
--- 419,430 ----
  	}
  	if (badWords.IsValid(p))
  	    parsedWords << p << ' ';
!         else if (boolean && ((mystrncasecmp(p, "or", 2) == 0) || 
!                              (mystrncasecmp(p, "and", 3) == 0) ||
!                              (mystrncasecmp(p, "not", 3) == 0)))
!         {
  	    parsedWords << p << ' ';
+         }
      }
  
      parsedWords.chop(' ');

brgds, H-P
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.
