summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:17 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:17 +0000
commit231fea14113439c08eba185830c58d716e905f87 (patch)
tree73c5c5970d1c64766eae5f9cd3d1b1b625adeabc /apt-pkg/pkgcache.cc
parent227051c0507218533c4b3e78aaf2c5359fdbfc4a (diff)
Fixed string case compare problem
Author: jgg Date: 1999-12-05 05:37:45 GMT Fixed string case compare problem
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 2a10928aa..5cf54b9aa 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcache.cc,v 1.29 1999/10/02 03:11:50 jgg Exp $
+// $Id: pkgcache.cc,v 1.30 1999/12/05 05:37:45 jgg Exp $
/* ######################################################################
Package Cache - Accessor code for the cache
@@ -27,6 +27,7 @@
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/version.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/strutl.h>
#include <system.h>
#include <string>
@@ -44,7 +45,7 @@ pkgCache::Header::Header()
/* Whenever the structures change the major version should be bumped,
whenever the generator changes the minor version should be bumped. */
MajorVersion = 3;
- MinorVersion = 4;
+ MinorVersion = 5;
Dirty = true;
HeaderSz = sizeof(pkgCache::Header);
@@ -136,7 +137,7 @@ unsigned long pkgCache::sHash(string Str) const
{
unsigned long Hash = 0;
for (const char *I = Str.begin(); I != Str.end(); I++)
- Hash = 5*Hash + *I;
+ Hash = 5*Hash + tolower(*I);
return Hash % _count(HeaderP->HashTable);
}
@@ -144,7 +145,7 @@ unsigned long pkgCache::sHash(const char *Str) const
{
unsigned long Hash = 0;
for (const char *I = Str; *I != 0; I++)
- Hash = 5*Hash + *I;
+ Hash = 5*Hash + tolower(*I);
return Hash % _count(HeaderP->HashTable);
}
@@ -159,9 +160,8 @@ pkgCache::PkgIterator pkgCache::FindPkg(string Name)
for (; Pkg != PkgP; Pkg = PkgP + Pkg->NextPackage)
{
if (Pkg->Name != 0 && StrP[Pkg->Name] == Name[0] &&
- StrP + Pkg->Name == Name)
+ stringcasecmp(Name.begin(),Name.end(),StrP + Pkg->Name) == 0)
return PkgIterator(*this,Pkg);
-// cout << "b" << flush;
}
return PkgIterator(*this,0);
}