#7 bug fix: parsing of date meta header

closed-accepted
nobody
stable (4)
5
2002-07-28
2002-07-10
Seb Wills
No

I found a bug in htdig/Retreiver.cc which prevents it
from correctly parsing YYYY-MM-DD dates in date meta
headers (it requires a space, rather than allowing a
hyphen, between YYYY and MM).

The patch (below) is trivial. This is for the 3.1.6
source - I haven't checked whether the problem is fixed
in the 3.2 source.

casi@sphinx$ diff -c Retriever.cc~ Retriever.cc
*** Retriever.cc~ Thu Jan 31 23:47:17 2002
--- Retriever.cc Wed Jul 10 00:38:05 2002
***************
*** 1139,1145 ****
year += 1900;
else if (year >= 19100) // seen some programs
do it, why not check?
year -= (19100-2000);
! while (isspace(*s))
s++;

// get month...
--- 1139,1145 ----
year += 1900;
else if (year >= 19100) // seen some programs
do it, why not check?
year -= (19100-2000);
! while (*s == '-' || isspace(*s))
s++;

// get month...

Discussion

  • Logged In: YES
    user_id=21420

    This has been fixed in the 3.1.6 source (thanks!). At the
    moment, the problem does not directly exist in the 3.2 source.

    -Geoff

     
    • status: open --> closed-accepted