From 3e80818c9c2d513a22c41c856efe6aec79f59a2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Fri, 25 Feb 2011 08:05:14 +0000 Subject: [PATCH] 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. --- log.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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') { -- 2.47.2