From: Frédéric Marchal Date: Tue, 25 Jan 2011 21:08:09 +0000 (+0000) Subject: Don't try to produce a parsed log if parsed_output_log is none X-Git-Tag: v2.3.2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8949e757f06d40a37b11fc1518f02e2b72276849;p=thirdparty%2Fsarg.git Don't try to produce a parsed log if parsed_output_log is none 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. --- diff --git a/log.c b/log.c index b3e2b6c..35734dd 100644 --- 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); }