summaryrefslogtreecommitdiff
path: root/lib/parsedate.c
Commit message (Collapse)AuthorAgeFilesLines
* stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.hYang Tse2011-07-261-7/+1
|
* parsedate: detect more invalid dates betterDaniel Stenberg2011-06-231-0/+4
|
* parsedate: turn private and staticDaniel Stenberg2011-06-031-3/+21
| | | | I removed the prefix as well accordingly.
* source cleanup: unify look, style and indent levelsDaniel Stenberg2011-04-271-3/+4
| | | | | By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
* Fix a couple of spelling errors in lib/Fabian Keil2011-04-211-1/+1
| | | | Found with codespell.
* gmtime: remove defineDaniel Stenberg2011-02-141-2/+2
| | | | | | 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.
* Curl_gmtime: avoid future mistakesDaniel Stenberg2011-02-071-0/+9
| | | | | Document Curl_gmtime() and define away the old functions so that they won't be used internally again by mistake.
* Curl_gmtime: added a portable gmtimeDaniel Stenberg2011-02-071-1/+18
| | | | | | 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.
* fix compiler warning: conversion may lose significant bitsYang Tse2010-12-011-1/+2
|
* parsedate: allow time specified without secondsDaniel Stenberg2010-09-271-0/+6
| | | | | | | | | 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
* parsedate: Value stored to 'found' is never readDaniel Stenberg2010-04-171-2/+1
|
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* - Ray Dassen provided a patch in Debian's bug tracker (bug number #551461)Daniel Stenberg2009-10-181-0/+30
| | | | | | 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.
* fix copyright yearDaniel Stenberg2009-09-031-1/+1
|
* provide and export Curl_parsedate() as a library-wide internal functionDaniel Stenberg2009-09-031-9/+39
| | | | for a better API to date parsing than the external API is
* moved the Curl_raw_ functions into the new lib/rawstr.c file for easier curlx_Daniel Stenberg2008-10-231-1/+1
| | | | inclusion by the curl tool without colliding with the curl_strequal functions.
* Changed some arrays of char* to arrays of char[] to reduce data size andDan Fandrich2008-10-221-1/+1
| | | | run-time relocations.
* Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper functionDaniel Stenberg2008-10-161-3/+3
| | | | used in strequal.c so now all test cases run fine for me again.
* - Pascal Terjan filed bug #2154627Daniel Stenberg2008-10-151-3/+4
| | | | | | | | | | | (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.
* I replaced the use of 'struct tm' with a private clone of that struct simplyDaniel Stenberg2008-10-091-5/+13
| | | | | 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.
* Made the month days table static constDan Fandrich2008-09-291-2/+6
|
* - Introducing Jamie Lokier's function for date to epoch conversion used in theDaniel Stenberg2008-09-231-32/+40
| | | | | | 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.
* fix compiler warning: external definition with no prior declarationYang Tse2008-09-181-0/+1
|
* Stopped using ranges in scanf character sequences (e.g. %[a-z]) since thatDan Fandrich2008-06-221-3/+1
| | | | | is not ANSI C, just a common extension. This caused problems on at least Open Watcom C.
* Jeff Johnson filed bug report #1863171Daniel Stenberg2008-01-061-4/+10
| | | | | | | (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.
* All static functions that were previously name Curl_* something no longerDaniel Stenberg2007-12-081-3/+3
| | | | | use that prefix as we use that prefix only for library-wide internal global symbols.
* if () => if()Daniel Stenberg2007-11-071-2/+2
| | | | | while () => while() and some other minor re-indentings
* Constified from arguments.Gisle Vanem2007-11-061-3/+3
|
* Martin Skinner brought back bug report #1230118 to haunt us once again.Daniel Stenberg2006-12-051-15/+12
| | | | | | (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.
* Avoid typecasting a signed char to an int when using is*() functions, as thatDaniel Stenberg2006-10-171-4/+4
| | | | | | | | | 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.
* fix questionable compareMarty Kuhrt2005-12-301-1/+1
|
* putting back into distMarty Kuhrt2005-12-301-1/+1
|
* Michael Wallner reported that the date parser had wrong offset stored forDaniel Stenberg2005-10-041-2/+2
| | | | the MEST and CEST time zones.
* Christopher R. Palmer fixed the offsets used for date parsings when the timeDaniel Stenberg2005-08-091-43/+44
| | | | | | | 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.
* Gisle Vanem came up with a nice little work-around for bug #1230118. ItDaniel Stenberg2005-07-051-1/+12
| | | | | | | 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.
* Cory Nelson's work on nuking compiler warnings when building on x64 withDaniel Stenberg2005-04-261-1/+1
| | | | VS2005.
* Updated the copyright year since changes have been this year.Daniel Stenberg2005-03-311-1/+1
|
* mktime() returns a time_t. time_t is often 32 bits, even on many architecturesDaniel Stenberg2005-03-081-1/+8
| | | | | | | | 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)
* Removed all uses of strftime() since it uses the localised version of theDaniel Stenberg2005-02-111-9/+9
| | | | week day names and month names and servers don't like that.
* Make some more arrays of pointers const.Dan Fandrich2004-12-201-6/+9
|
* if gmtime() returns NULL, this returns -1 to bail out nicelyDaniel Stenberg2004-11-291-0/+2
|
* dates from 2038 or later now return 0x7fffffff when 32 bit time_t is usedDaniel Stenberg2004-11-111-0/+6
|
* less long => int implicit conversion warningsDaniel Stenberg2004-09-201-4/+4
|
* Replaced the former date parser with a rewrite. No more yacc/bison needed.Daniel Stenberg2004-09-151-1/+1
|
* and moved back the month array to a static one since the ftp code won't needDaniel Stenberg2004-09-131-5/+3
| | | | it anymore
* support for YYYYMMDD added, which allows us to keep using the lib/ftp.c codeDaniel Stenberg2004-09-131-38/+27
| | | | I was previously #ifdef'ing to a different look when this parser is used
* added more examples/docs in the top commentDaniel Stenberg2004-09-131-2/+12
|
* Since many users probably already use local time strings as input, I nowDaniel Stenberg2004-09-131-23/+92
| | | | | | | | 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
* more docs and fixed the delta compared to GMT that prevented test case 141 toDaniel Stenberg2004-09-111-5/+31
| | | | work with this
* slightly better but still lacksDaniel Stenberg2004-09-111-37/+14
|