]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't try to produce a parsed log if parsed_output_log is none
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:08:09 +0000 (21:08 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:08:09 +0000 (21:08 +0000)
The correct value to set in parsed_output_log to disable the parsed
log is "no" but if the user enters "none" as is usual with the other
parameters, parsed_output_log is set to an empty string which is not
equivalent to "no". The creation of the parsed log would then proceed
and fail because the path is invalid.

log.c

diff --git a/log.c b/log.c
index b3e2b6c5222fce2a9116f3d6566098a526bbc9de..35734ddad3c77f14dc90466f06a84e88ea8702bb 100644 (file)
--- a/log.c
+++ b/log.c
@@ -260,7 +260,7 @@ int main(int argc,char *argv[])
        strcpy(IndexSortOrder,"D");
        ShowSargInfo=true;
        ShowSargLogo=true;
-       strcpy(ParsedOutputLog,"no");
+       ParsedOutputLog[0]='\0';
        strcpy(ParsedOutputLogCompress,"/bin/gzip -f");
        DisplayedValues=DISPLAY_ABBREV;
        strcpy(HeaderFontSize,"9px");
@@ -867,7 +867,7 @@ int main(int argc,char *argv[])
                                }
                        }
 
-                       if(!fp_log && strcmp(ParsedOutputLog, "no") != 0 && ilf!=ILF_Sarg) {
+                       if(!fp_log && ParsedOutputLog[0] && ilf!=ILF_Sarg) {
                                if(access(ParsedOutputLog,R_OK) != 0) {
                                        my_mkdir(ParsedOutputLog);
                                }