Tested on Debian Squeeze, Curl version 7.21.0
RFC 822 as I read it shows that seconds are optional when specifying the date format. However when passing a date with a seconds field results in a -1 error. Some RSS feeds I use don't specify the seconds on there publish date. The attached file shows the bad behaviour.
That should read "passing a date *without* a seconds field". Poor bug reporting that. :-)
Ack.
I've tried with the patch that I'll show here and it seems to work. I'll commit and push this within shortly:
--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -371,6 +371,12 @@ int Curl_parsedate(const char *date, time_t *output)
/* time stamp! */
date += 8;
}
+ else if((secnum == -1) &&
+ (2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) {
+ /* time stamp without seconds */
+ date += 5;
+ secnum = 0;
+ }
else {
val = (int)strtol(date, &end, 10);
Thanks for the report, this problem is now fixed in the git repository.
To try it out, you either checkout/update your git clone: http://curl.haxx.se/source.html
or you try tomorrow's daily snapshot: http://curl.haxx.se/snapshots/