From: Frédéric Marchal Date: Fri, 25 Feb 2011 08:05:14 +0000 (+0000) Subject: Take the date_format into account when converting a file X-Git-Tag: v2.3.2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e80818c9c2d513a22c41c856efe6aec79f59a2c;p=thirdparty%2Fsarg.git Take the date_format into account when converting a file The date_format parameter read from sarg.conf was taken into account too late in the program flow and was ignored during the convertion or the splitting of a file. Only command line option -g was effective. --- diff --git a/log.c b/log.c index 6298e8e..28115b1 100644 --- a/log.c +++ b/log.c @@ -560,6 +560,16 @@ int main(int argc,char *argv[]) if(DataFile[0] != '\0') dataonly++; + if(df[0] == '\0') strcpy(df,DateFormat); + else strcpy(DateFormat,df); + + if(df[0] == '\0') { + strcpy(df,"u"); + strcpy(DateFormat,"u"); + } + if (df[0]=='w') + IndexTree=INDEX_TREE_FILE; + if(NAccessLog == 0) { strcpy(AccessLog[0],"/var/log/squid/access.log"); NAccessLog++; @@ -630,16 +640,6 @@ int main(int argc,char *argv[]) exit(EXIT_FAILURE); } - if(df[0] == '\0') strcpy(df,DateFormat); - else strcpy(DateFormat,df); - - if(df[0] == '\0') { - strcpy(df,"u"); - strcpy(DateFormat,"u"); - } - if (df[0]=='w') - IndexTree=INDEX_TREE_FILE; - if(email[0] == '\0' && OutputEmail[0] != '\0') strcpy(email,OutputEmail); if(email[0] != '\0') {