]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Force a default value for a boolean parameter if the language file is not updated
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 6 Jan 2010 09:27:19 +0000 (09:27 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 6 Jan 2010 09:27:19 +0000 (09:27 +0000)
getconf.c

index ea57749676f4cbd9763a8b578b0a8b9bbd5a96c5..9a0dfe5d4c754dbcfa4b63871e581e6bb438efbc 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -1,6 +1,6 @@
 /*
  * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
- *                                                            1998, 2009
+ *                                                            1998, 2010
  * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
@@ -159,7 +159,9 @@ static int getparam_bool(const char *param,char *buf,int *value)
    while (*buf && (unsigned char)*buf<=' ') buf++;
 
    *value=0;
-   for (str=text[144] ; *str ; str+=i) {
+   str=text[144];
+   if (str == NULL || *str == '\0') str="yes";
+   for ( ; *str ; str+=i) {
       for (i=0 ; str[i] && str[i]!=',' ; i++);
       if (strncasecmp(str,buf,i)==0) {
          *value=1;