K 10
svn:author
V 6
iulius
K 8
svn:date
V 27
2012-06-11T19:10:59.542775Z
K 7
svn:log
V 1326
fix the generation of HTML pages by innreport during leap years

An illegal division by zero occurred during the generation of HTML pages
by innreport.

The problem comes from the parsing of innreport.db.  If you have in this
file a change of year for which the hours are the same between Dec 31th
and Jan 1st, then this error is generated.

For instance:

  news-notice.2010.12.31-04.15.02.html|Dec 31 04:15:02 -- Jan  1 04:15:02|28079|2791|7.9 MB|34320|1500|4.6 MB

There is an issue in how innreport translates these dates.  The ConvDate()
function assumes the dates are relative to the *current* year.  So it
thinks it has been between Dec 31th 2012 and Jan 1st 2012 (whereas it was
Dec 31th 2010 and Jan 1st 2011).  As 2012 is a leap year, and Dec 31th is
after Feb 28th, the translated date contains an unexpected "+1 day".

Thus, the main page of innreport HTML generation has not been updated
since the beginning of the year.  Note that no HTML report is lost.
They are properly generated.

Now, innreport makes use of Time::Local to convert dates to seconds since
epoch, thus modifying the behaviour of ConvDate() which was converting
dates to seconds since January, 1st.

I bet innreport now runs slower, but I think it is better to achieve
robustness (the code using Time::Local seems easier to read and maintain).

END
