index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2013-03-10 23:01:55 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-14 11:47:11 +1000 |
commit | 163c36bdcde6aa324060bafe5674ea83cf556fd8 (patch) | |
tree | cd7f67f55b2e24ca3fd70ac02b61e1a7b6a0e9e3 /lib | |
parent | 62f828014f17596cf8fb5cd2ea0c34cb754f75cb (diff) |
-rw-r--r-- | lib/libalpm/util.c | 6 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index f4c33a0d..dc1d0435 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -1170,12 +1170,16 @@ alpm_time_t _alpm_parsedate(const char *line) errno = 0; if(isalpha((unsigned char)line[0])) { + const char *oldlocale; /* initialize to null in case of failure */ struct tm tmp_tm; memset(&tmp_tm, 0, sizeof(struct tm)); + + oldlocale = setlocale(LC_TIME, NULL); setlocale(LC_TIME, "C"); strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm); - setlocale(LC_TIME, ""); + setlocale(LC_TIME, oldlocale); + return (alpm_time_t)mktime(&tmp_tm); } |