diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-04-23 12:53:48 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-04-23 12:53:48 +0200 |
commit | 4e86942abf369e5bce6c3612d0e8f2aa5a9f2821 (patch) | |
tree | 857ceb635f174ac61e35913b78e131cb5804dd4b /apt-pkg/pkgcache.cc | |
parent | c5d8878d1ffe7484e049f52189a07f3847e4fda9 (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)
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 4fbf42c4b..6687864ee 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -163,7 +163,7 @@ unsigned long pkgCache::sHash(const string &Str) const { unsigned long Hash = 0; for (string::const_iterator I = Str.begin(); I != Str.end(); I++) - Hash = 5*Hash + tolower(*I); + Hash = 5*Hash + tolower_ascii(*I); return Hash % _count(HeaderP->HashTable); } @@ -171,7 +171,7 @@ unsigned long pkgCache::sHash(const char *Str) const { unsigned long Hash = 0; for (const char *I = Str; *I != 0; I++) - Hash = 5*Hash + tolower(*I); + Hash = 5*Hash + tolower_ascii(*I); return Hash % _count(HeaderP->HashTable); } |