]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Read the useragent log even if no report date is specified
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 25 May 2015 18:14:05 +0000 (20:14 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 25 May 2015 18:14:05 +0000 (20:14 +0200)
The useragent log was ignored if the report date was not defined on the
command line. The only way to generate the useragent log was to use
command line option -d.

useragent.c

index a3b5a4d4a3fed40475199a399710d87dcf892555..fd4179f32f6b3e2f00e543d230028c738d393332 100644 (file)
@@ -89,10 +89,12 @@ void useragent(void)
                        debuga(__FILE__,__LINE__,_("Invalid date in file \"%s\"\n"),UserAgentLog);
                        exit(EXIT_FAILURE);
                }
-               buildymd(day,month,year,wdate,sizeof(wdate));
-               ndate=atoi(wdate);
-               if (ndate<dfrom) continue;
-               if (ndate>duntil) break;
+               if (dfrom!=0 || duntil!=0){
+                       buildymd(day,month,year,wdate,sizeof(wdate));
+                       ndate=atoi(wdate);
+                       if (ndate<dfrom) continue;
+                       if (ndate>duntil) break;
+               }
                if(totregsl == 1)
                        strcpy(idate,data);
                strcpy(fdate,data);