parent
8c6c44d3eb
commit
4846c498c7
|
@ -480,11 +480,12 @@ http_parse_mtime(const char *p, time_t *mtime)
|
||||||
char *locale, *r;
|
char *locale, *r;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
locale = strdupa(setlocale(LC_TIME, NULL));
|
locale = strdup(setlocale(LC_TIME, NULL));
|
||||||
setlocale(LC_TIME, "C");
|
setlocale(LC_TIME, "C");
|
||||||
r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
|
r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
|
||||||
/* XXX should add support for date-2 and date-3 */
|
/* XXX should add support for date-2 and date-3 */
|
||||||
setlocale(LC_TIME, locale);
|
setlocale(LC_TIME, locale);
|
||||||
|
free(locale);
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
*mtime = timegm(&tm);
|
*mtime = timegm(&tm);
|
||||||
|
|
Loading…
Reference in New Issue