From 2c46b12f971df006ab8cb99e5cdf33ba58ab19d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sun, 26 Aug 2012 17:25:49 +0200 Subject: [PATCH] Accept common log files without extension column 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readlog_common.c b/readlog_common.c index af85312..6c8917a 100644 --- a/readlog_common.c +++ b/readlog_common.c @@ -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")); -- 2.47.2