summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2010-06-10 14:01:18 +0200
committerMichael Vogt <mvo@debian.org>2010-06-10 14:01:18 +0200
commite934f8c63aabf4ff94962a4602c143b52b19b3cb (patch)
tree8f4774cc300c0621cc4532b53eef2a04e5e56b3c /apt-pkg/contrib/strutl.cc
parent189bb640d2443a5fcaade2ce169429c629ba3148 (diff)
parent97f4026d93a85838439263d30146c3ad25fef474 (diff)
merged from david
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 160450366..ace74cb37 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -861,12 +861,16 @@ static time_t timegm(struct tm *t)
bool RFC1123StrToTime(const char* const str,time_t &time)
{
struct tm Tm;
+ setlocale (LC_ALL,"C");
+ bool const invalid =
// Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
- if (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL &&
+ (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL &&
// Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
strptime(str, "%A, %d-%b-%y %H:%M:%S %Z", &Tm) == NULL &&
// Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
- strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL)
+ strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL);
+ setlocale (LC_ALL,"");
+ if (invalid == true)
return false;
time = timegm(&Tm);