File sarg-2.2.5-year_assertion.patch of Package sarg
--- sarg-2.2.5/index.c.orig 2008-09-08 20:12:37.000000000 +0200
+++ sarg-2.2.5/index.c 2008-09-09 11:36:24.000000000 +0200
@@ -167,6 +167,7 @@ void make_index()
dirp = opendir(outdir);
while ((direntp = readdir( dirp )) != NULL) {
+ char *p;
if(strcmp(IndexTree,"date") == 0) {
if(strlen(direntp->d_name) > 4 || !isdigit(direntp->d_name[0]) && !isdigit(direntp->d_name[1])) continue;
fprintf(fp_tmp,"%s %s\n",direntp->d_name,get_size(outdir,direntp->d_name));
@@ -194,8 +195,9 @@ void make_index()
getword(mon,sizeof(mon),html,' ');
getword(day,sizeof(day),html,' ');
getword(hour,sizeof(hour),html,' ');
- getword(year,sizeof(year),html,' ');
- getword(year,sizeof(year),html,' ');
+ p = strchr(html, ' ');
+ if (!p) p = html;
+ getword(year,sizeof(year),p,' ');
strcpy(html,hour);
getword(h,sizeof(h),html,':');
getword(m,sizeof(m),html,':');