According to Alexey Rodriguez:
>       I am releasing a patch for choosing boolean keywords from
> configuration file. The attribute should look like:
> 
>       boolean_keywords: and or not
> 
>       If you don't put anything it doesn't matter what is the default
> value. For example i use:
> 
>       boolean_keywords: y o no
> 
>       The error messages are still in english. Any suggestions are
> welcome and i expect that i did not break anything. ;)

The only problem I can see is if the user enters more than 3 strings
in the boolean_keywords string list, it will overflow the String array.
You should probably add a test in the loop to avoid this.  E.g.:

> + String boolean_keywords[3];
> +
> + void load_boolean_keywords()
> + {
> +     String temp=config["boolean_keywords"];
> +     char *w=strtok(temp," \t");
> +     int i=0;
> +     while(w) {
  
          if (i<3) {    // don't go out of bounds
  
> +         boolean_keywords[i]=w;
> +       boolean_keywords[i].lowercase();
  
          }
  
> +       w=strtok(NULL," \t");
> +       i++;
> +     }
> +     if(i!=3) {
> +         reportError("boolean_keywords is not correctly specified");
> +     }
> + }

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.

Reply via email to