aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-01-06 10:50:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-01-06 10:50:57 +0000
commit423309541a1952ab0b340361d0a752d289d9653f (patch)
tree9734ce82fad0f1efc22332cc0a582ec81e8f5b38 /lib
parent9c6533d28720b38e52827ccd6d2f831553e73442 (diff)
Jeff Johnson filed bug report #1863171
(http://curl.haxx.se/bug/view.cgi?id=1863171) where he pointed out that libcurl's date parser didn't accept a +1300 time zone which actually is used fairly often (like New Zealand's Dailight Savings Time), so I modified the parser to now accept up to and including -1400 to +1400.
Diffstat (limited to 'lib')
-rw-r--r--lib/parsedate.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/parsedate.c b/lib/parsedate.c
index 0f0a18629..78cc96fe2 100644
--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -289,11 +289,17 @@ static time_t parsedate(const char *date)
if((tzoff == -1) &&
((end - date) == 4) &&
- (val < 1300) &&
+ (val <= 1400) &&
(indate< date) &&
((date[-1] == '+' || date[-1] == '-'))) {
- /* four digits and a value less than 1300 and it is preceeded with
- a plus or minus. This is a time zone indication. */
+ /* four digits and a value less than or equal to 1400 (to take into
+ account all sorts of funny time zone diffs) and it is preceeded
+ with a plus or minus. This is a time zone indication. 1400 is
+ picked since +1300 is frequently used and +1400 is mentioned as
+ an edge number in the document "ISO C 200X Proposal: Timezone
+ Functions" at http://david.tribble.com/text/c0xtimezone.html If
+ anyone has a more authoritative source for the exact maximum time
+ zone offsets, please speak up! */
found = TRUE;
tzoff = (val/100 * 60 + val%100)*60;