]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Extract the covered period from the sarg log file
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Aug 2012 13:53:52 +0000 (15:53 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Aug 2012 14:00:38 +0000 (16:00 +0200)
A sarg log file is named after the covered date range. The range is
extracted and used in the report.

readlog_sarg.c

index ed93dfce6a2b5ec01097fa4ecf517f60ca1c3467..106f4c3be66d83efa8390016e59787da2bfe3029 100644 (file)
@@ -36,6 +36,10 @@ A new file is being read. The name of the file is \a FileName.
 static void Sarg_NewFile(const char *FileName)
 {
        InSargLog=false;
+       if (getperiod_fromsarglog(FileName,&period)<0) {
+               debuga(_("The name of the file is invalid: %s\n"),FileName);
+               exit(EXIT_FAILURE);
+       }
 }
 
 /*!