htdig: StringList: empty List elements


Alexander Bergolth (leo@strike.wu-wien.ac.at)
Fri, 2 Oct 1998 14:09:58 +0200 (MES)


Hello!

In StringList::Create empty elements are added to the list if there are
more than one subsequent delimiter characters between the patterns.

Is this a bug or a feature? (This leads to empty entries in the initial
URL list if you split the start_urls variable into several lines.)

The following patch eliminates the empty elements:

---------- snipp! ----------

--- htdig-3.1.0b1/htlib/StringList.cc Tue Sep 8 05:29:55 1998
+++ htdig-3.1.0b1-new/htlib/StringList.cc Fri Oct 2 13:47:07 1998
@@ -102,8 +102,11 @@
     {
         if (strchr(sep, *str))
         {
+ if (word.length())
+ {
             List::Add(new String(word));
             word = 0;
+ }
         }
         else
             word << *str;
@@ -130,8 +133,11 @@
     {
         if (*str == sep)
         {
+ if (word.length())
+ {
             List::Add(new String(word));
             word = 0;
+ }
         }
         else
             word << *str;

---------- snipp! ----------

-----------------------------------------------------------------------
Alexander (Leo) Bergolth leo@leo.wu-wien.ac.at
WU-Wien - Zentrum fuer Informatikdienste http://leo.wu-wien.ac.at
Info Center
In a world without walls and fences, who needs windows and gates?

----------------------------------------------------------------------
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.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:28:27 PST