]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Accept common log files without extension column
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Aug 2012 15:25:49 +0000 (17:25 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 26 Aug 2012 15:25:49 +0000 (17:25 +0200)
The sample common log file used to test the program contained additional
columns. The standard common log format doesn't have those column. Sarg
failed to parse the standard format due to the lack of any supernumerary
column.

readlog_common.c

index af853129eae7a594f1a14a52c2faad5ac432dc7c..6c8917a90fe15a86cbdea810258ba8fa8ba93093 100644 (file)
@@ -162,8 +162,9 @@ static enum ReadLogReturnCodeEnum Common_ReadEntry(char *Line,struct ReadLogStru
        Begin=++Line;
        Entry->DataSize=0LL;
        while (isdigit(*Line)) Entry->DataSize=Entry->DataSize*10+(*Line++-'0');
-       if (*Line!=' ' || Begin==Line) return(RLRC_Unknown);
-       
+       // some log contains more columns
+       if ((*Line && *Line!=' ') || Begin==Line) return(RLRC_Unknown);
+
        // check the entry time
        if (mktime(&Entry->EntryTime)==-1) {
                debuga(_("Invalid date or time found in the common log file\n"));