summaryrefslogtreecommitdiff
path: root/ftparchive/cachedb.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2006-07-25 09:37:35 +0200
committerMichael Vogt <egon@bottom>2006-07-25 09:37:35 +0200
commit67fefcfec18c9ada43a07e5fffae6b3a5c693388 (patch)
treee155112df729af1446676a77752274eda30423e0 /ftparchive/cachedb.cc
parentee8a0bbceed82c8bfd45e04fe5ca1a7b472e6244 (diff)
parentfab58e35bd7ea1825d522dc1467dff66bc974b74 (diff)
* merged with mainline
Diffstat (limited to 'ftparchive/cachedb.cc')
-rw-r--r--ftparchive/cachedb.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index 0e6078642..8a4ca0236 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -453,15 +453,14 @@ bool CacheDB::Clean()
memset(&Data,0,sizeof(Data));
while ((errno = Cursor->c_get(Cursor,&Key,&Data,DB_NEXT)) == 0)
{
- const char *Colon = (char *)Key.data;
- for (; Colon != (char *)Key.data+Key.size && *Colon != ':'; Colon++);
- if ((char *)Key.data+Key.size - Colon > 2)
+ const char *Colon = (char*)memrchr(Key.data, ':', Key.size);
+ if (Colon)
{
- if (stringcmp((char *)Key.data,Colon,"st") == 0 ||
- stringcmp((char *)Key.data,Colon,"cn") == 0 ||
- stringcmp((char *)Key.data,Colon,"cl") == 0)
+ if (stringcmp(Colon + 1, (char *)Key.data+Key.size,"st") == 0 ||
+ stringcmp(Colon + 1, (char *)Key.data+Key.size,"cl") == 0 ||
+ stringcmp(Colon + 1, (char *)Key.data+Key.size,"cn") == 0)
{
- if (FileExists(string(Colon+1,(const char *)Key.data+Key.size)) == true)
+ if (FileExists(string((const char *)Key.data,Colon)) == true)
continue;
}
}