aboutsummaryrefslogtreecommitdiff
path: root/lib/parsedate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-09-27 16:54:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-09-27 16:54:02 +0200
commit4d58f97f604bfef5b2cb7538f9bbc925c141622f (patch)
tree727e59deebfbb18e848e1856b68ef293e3e2ad38 /lib/parsedate.c
parent33c3bb057b0814f4738bf055f7a153731a9f2352 (diff)
parsedate: allow time specified without seconds
The date format in RFC822 allows that the seconds part of HH:MM:SS is left out, but this function didn't allow it. This change also includes a modified test case that makes sure that this now works. Reported by: Matt Ford Bug: http://curl.haxx.se/bug/view.cgi?id=3076529
Diffstat (limited to 'lib/parsedate.c')
-rw-r--r--lib/parsedate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/parsedate.c b/lib/parsedate.c
index 26f7d84ce..5d8af2692 100644
--- 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);