|
bagder: curl/lib parsedate.c,1.16,1.17: msg#00005web.curl.cvs
Update of /cvsroot/curl/curl/lib In directory labb:/tmp/cvs-serv31089/lib Modified Files: parsedate.c Log Message: Gisle Vanem came up with a nice little work-around for bug #1230118. It 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. Index: parsedate.c =================================================================== RCS file: /cvsroot/curl/curl/lib/parsedate.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- parsedate.c 26 Apr 2005 13:08:49 -0000 1.16 +++ parsedate.c 5 Jul 2005 14:57:41 -0000 1.17 @@ -236,9 +236,20 @@ struct tm tm; enum assume dignext = DATE_MDAY; const char *indate = date; /* save the original pointer */ - int part = 0; /* max 6 parts */ +#ifdef WIN32 + /* + * On Windows, we need an odd work-around for the case when no TZ variable + * is set. If it isn't set and "automatic DST adjustment" is enabled, the + * time functions below will return values one hour off! As reported and + * investigated in bug report #1230118. + */ + const char *env = getenv("TZ"); + if(!env) + putenv("TZ=GMT"); +#endif + while(*date && (part < 6)) { bool found=FALSE; _______________________________________________ http://cool.haxx.se/mailman/listinfo/curl-commits |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | bagder: curl CHANGES,1.726,1.727 RELEASE-NOTES,1.262,1.263: 00005, cvs |
|---|---|
| Next by Date: | bagder: curl CHANGES,1.727,1.728 RELEASE-NOTES,1.263,1.264: 00005, cvs |
| Previous by Thread: | bagder: curl CHANGES,1.726,1.727 RELEASE-NOTES,1.262,1.263i: 00005, cvs |
| Next by Thread: | bagder: curl CHANGES,1.727,1.728 RELEASE-NOTES,1.263,1.264: 00005, cvs |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |