X-Git-Url: http://www.privoxy.org/gitweb/config.html?a=blobdiff_plain;f=parsers.c;h=6e9645e35eaa405eedbebc4b52fcc8238ddd6e32;hb=22ab3219f632f2dc4c4323ee6daca13ff3ac19b6;hp=ce76dc7c838dc360d96d86dd7ff9df0e2e05fb55;hpb=e59766778d6b05c1bffb89f18cefa888a8f5ff40;p=privoxy.git diff --git a/parsers.c b/parsers.c index ce76dc7c..6e9645e3 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.229 2011/09/04 11:31:45 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.230 2011/09/04 11:32:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -4008,13 +4008,18 @@ int strclean(char *string, const char *substring) static jb_err parse_header_time(const char *header_time, time_t *result) { struct tm gmt; + /* + * Checking for two-digit years first in an + * attempt to work around GNU libc's strptime() + * reporting negative year values when using %Y. + */ static const char *time_formats[] = { + /* Tue, 02-Jun-37 20:00:00 */ + "%a, %d-%b-%y %H:%M:%S", /* Tue, 02 Jun 2037 20:00:00 */ "%a, %d %b %Y %H:%M:%S", /* Tue, 02-Jun-2037 20:00:00 */ "%a, %d-%b-%Y %H:%M:%S", - /* Tue, 02-Jun-37 20:00:00 */ - "%a, %d-%b-%y %H:%M:%S", /* Tuesday, 02-Jun-2037 20:00:00 */ "%A, %d-%b-%Y %H:%M:%S", /* Tuesday Jun 02 20:00:00 2037 */