diff options
-rw-r--r-- | lib/parsedate.c | 6 | ||||
-rw-r--r-- | tests/data/test517 | 1 | ||||
-rw-r--r-- | tests/libtest/lib517.c | 2 |
3 files changed, 9 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); diff --git a/tests/data/test517 b/tests/data/test517 index 04aa6a089..d7b91842c 100644 --- a/tests/data/test517 +++ b/tests/data/test517 @@ -103,6 +103,7 @@ nothing 74: Thu, 999999999999-Aug-2007 20:49:07 GMT => -1 75: Thu, 12-Aug-2007 20:61:99999999999 GMT => -1 76: IAintNoDateFool => -1 +77: Thu Apr 18 22:50 2007 GMT => 1176936600 </stdout> # This test case previously testes an overflow case ("2094 Nov 6 => diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index 3f7b064ab..38a65d30b 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -97,6 +97,8 @@ static const char *dates[]={ "Thu, 999999999999-Aug-2007 20:49:07 GMT", "Thu, 12-Aug-2007 20:61:99999999999 GMT", "IAintNoDateFool", + "Thu Apr 18 22:50 2007 GMT", /* without seconds */ + NULL }; |