aboutsummaryrefslogtreecommitdiff
path: root/lib/parsedate.c
AgeCommit message (Collapse)Author
2011-02-14gmtime: remove defineDaniel Stenberg
It turns out some systems rely on the gmtime or gmtime_r to be defined already in the system headers and thus my "precaution" redefining of them only caused trouble. They are now removed.
2011-02-07Curl_gmtime: avoid future mistakesDaniel Stenberg
Document Curl_gmtime() and define away the old functions so that they won't be used internally again by mistake.
2011-02-07Curl_gmtime: added a portable gmtimeDaniel Stenberg
Instead of polluting many places with #ifdefs, we create a single place for this function, and also check return code properly so that a NULL pointer returned won't cause problems.
2010-12-01fix compiler warning: conversion may lose significant bitsYang Tse
2010-09-27parsedate: allow time specified without secondsDaniel Stenberg
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
2010-04-17parsedate: Value stored to 'found' is never readDaniel Stenberg
2010-03-24remove the CVSish $Id$ linesDaniel Stenberg
2009-10-18- Ray Dassen provided a patch in Debian's bug tracker (bug number #551461)Daniel Stenberg
that now makes curl_getdate(3) actually handles RFC 822 formatted dates that use the "single letter military timezones". http://www.rfc-ref.org/RFC-TEXTS/822/chapter5.html has the details.
2009-09-03fix copyright yearDaniel Stenberg
2009-09-03provide and export Curl_parsedate() as a library-wide internal functionDaniel Stenberg
for a better API to date parsing than the external API is
2008-10-23moved the Curl_raw_ functions into the new lib/rawstr.c file for easier curlx_Daniel Stenberg
inclusion by the curl tool without colliding with the curl_strequal functions.
2008-10-22Changed some arrays of char* to arrays of char[] to reduce data size andDan Fandrich
run-time relocations.
2008-10-16Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper functionDaniel Stenberg
used in strequal.c so now all test cases run fine for me again.
2008-10-15- Pascal Terjan filed bug #2154627Daniel Stenberg
(http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl uses strcasecmp() in multiple places where it causes failures when the Turkish locale is used. This is because 'i' and 'I' isn't the same letter so strcasecmp() on those letters are different in Turkish than in English (or just about all other languages). I thus introduced a totally new internal function in libcurl (called Curl_ascii_equal) for doing case insentive comparisons for english-(ascii?) style strings that thus will make "file" and "FILE" match even if the Turkish locale is selected.
2008-10-09I replaced the use of 'struct tm' with a private clone of that struct simplyDaniel Stenberg
because the struct is declared on the stack and not all members are used so we could just as well make struct with only struct members we actually need.
2008-09-29Made the month days table static constDan Fandrich
2008-09-23- Introducing Jamie Lokier's function for date to epoch conversion used in theDaniel Stenberg
date parser function. This makes our function less dependent on system- provided functions and instead we do all the magic ourselves. We also no longer depend on the TZ environment variable.
2008-09-18fix compiler warning: external definition with no prior declarationYang Tse
2008-06-22Stopped using ranges in scanf character sequences (e.g. %[a-z]) since thatDan Fandrich
is not ANSI C, just a common extension. This caused problems on at least Open Watcom C.
2008-01-06Jeff Johnson filed bug report #1863171Daniel Stenberg
(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.
2007-12-08All static functions that were previously name Curl_* something no longerDaniel Stenberg
use that prefix as we use that prefix only for library-wide internal global symbols.
2007-11-07if () => if()Daniel Stenberg
while () => while() and some other minor re-indentings
2007-11-06Constified from arguments.Gisle Vanem
2006-12-05Martin Skinner brought back bug report #1230118 to haunt us once again.Daniel Stenberg
(http://curl.haxx.se/bug/view.cgi?id=1230118) curl_getdate() did not work properly for all input dates on Windows. It was mostly seen on some TZ time zones using DST. Luckily, Martin also provided a fix.
2006-10-17Avoid typecasting a signed char to an int when using is*() functions, as thatDaniel Stenberg
could very well cause a negate number get passed in and thus cause reading outside of the array usually used for this purpose. We avoid this by using the uppercase macro versions introduced just now that does some extra crazy typecasts to avoid byte codes > 127 to cause negative int values.
2005-12-30fix questionable compareMarty Kuhrt
2005-12-30putting back into distMarty Kuhrt
2005-10-04Michael Wallner reported that the date parser had wrong offset stored forDaniel Stenberg
the MEST and CEST time zones.
2005-08-09Christopher R. Palmer fixed the offsets used for date parsings when the timeDaniel Stenberg
zone name of a daylight savings time was used. For example, PDT vs PDS. This flaw was introduced with the new date parser (11 sep 2004 - 7.12.2). Fortunately, no web server or cookie string etc should be using such time zone names thus limiting the effect of this bug.
2005-07-05Gisle Vanem came up with a nice little work-around for bug #1230118. ItDaniel Stenberg
seems the Windows (MSVC) libc time functions may return data one hour off if TZ is not set and automatic DST adjustment is enabled. This made curl_getdate() return wrong value, and it also concerned internal cookie expirations etc.
2005-04-26Cory Nelson's work on nuking compiler warnings when building on x64 withDaniel Stenberg
VS2005.
2005-03-31Updated the copyright year since changes have been this year.Daniel Stenberg
2005-03-08mktime() returns a time_t. time_t is often 32 bits, even on many architecturesDaniel Stenberg
that feature 64 bit 'long'. Some systems have 64 bit time_t and deal with years beyond 2038. However, even some of the systems with 64 bit time_t returns -1 for dates beyond 03:14:07 UTC, January 19, 2038. (Such as AIX 5100-06)
2005-02-11Removed all uses of strftime() since it uses the localised version of theDaniel Stenberg
week day names and month names and servers don't like that.
2004-12-20Make some more arrays of pointers const.Dan Fandrich
2004-11-29if gmtime() returns NULL, this returns -1 to bail out nicelyDaniel Stenberg
2004-11-11dates from 2038 or later now return 0x7fffffff when 32 bit time_t is usedDaniel Stenberg
2004-09-20less long => int implicit conversion warningsDaniel Stenberg
2004-09-15Replaced the former date parser with a rewrite. No more yacc/bison needed.Daniel Stenberg
2004-09-13and moved back the month array to a static one since the ftp code won't needDaniel Stenberg
it anymore
2004-09-13support for YYYYMMDD added, which allows us to keep using the lib/ftp.c codeDaniel Stenberg
I was previously #ifdef'ing to a different look when this parser is used
2004-09-13added more examples/docs in the top commentDaniel Stenberg
2004-09-13Since many users probably already use local time strings as input, I nowDaniel Stenberg
made it deal with named time zones as well as mail-style +0200 ones. Seems to work fine. I'm comparing with GNU date command: date -d [date] -u +%s
2004-09-11more docs and fixed the delta compared to GMT that prevented test case 141 toDaniel Stenberg
work with this
2004-09-11slightly better but still lacksDaniel Stenberg
2004-09-11getdate replacement code. smaller, slicker, faster.Daniel Stenberg