diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-04-24 19:53:19 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-04-24 19:53:19 +0200 |
commit | 76dbdfc7f02096758f63bcb6d306b54d5a2d0d02 (patch) | |
tree | 0c9bc6a3e480e952a8817fc8165e8d81fadc5e45 /apt-pkg/contrib | |
parent | 3a41eec0084219731dc48d5cf7ecd803ea6d5483 (diff) |
* fix problematic use of tolower() when calculating the version
hash by using locale independant tolower_ascii() function.
Thanks to M. Vefa Bicakci (LP: #80248)
* build fixes for g++-4.4
* include dmesg output in apport package failures
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/sha256.h | 1 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 11 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.h | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/apt-pkg/contrib/sha256.h b/apt-pkg/contrib/sha256.h index 1951f053b..5934b5641 100644 --- a/apt-pkg/contrib/sha256.h +++ b/apt-pkg/contrib/sha256.h @@ -17,6 +17,7 @@ #include <string> #include <cstring> #include <algorithm> +#include <stdint.h> using std::string; using std::min; diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index fe9082f63..3b7a67db0 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1074,6 +1074,17 @@ char *safe_snprintf(char *Buffer,char *End,const char *Format,...) } /*}}}*/ +// tolower_ascii - tolower() function that ignores the locale /*{{{*/ +// --------------------------------------------------------------------- +/* */ +int tolower_ascii(int c) +{ + if (c >= 'A' and c <= 'Z') + return c + 32; + return c; +} + /*}}}*/ + // CheckDomainList - See if Host is in a , seperate list /*{{{*/ // --------------------------------------------------------------------- /* The domain list is a comma seperate list of domains that are suffix diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index d9972abf4..51416a24a 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -62,6 +62,7 @@ void ioprintf(ostream &out,const char *format,...) APT_FORMAT2; void strprintf(string &out,const char *format,...) APT_FORMAT2; char *safe_snprintf(char *Buffer,char *End,const char *Format,...) APT_FORMAT3; bool CheckDomainList(const string &Host, const string &List); +int tolower_ascii(int c); #define APT_MKSTRCMP(name,func) \ inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \ |