summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-04-23 12:53:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-04-23 12:53:48 +0200
commit4e86942abf369e5bce6c3612d0e8f2aa5a9f2821 (patch)
tree857ceb635f174ac61e35913b78e131cb5804dd4b /apt-pkg/contrib/strutl.cc
parentc5d8878d1ffe7484e049f52189a07f3847e4fda9 (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/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 327381d03..0b1bc3c98 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