diff options
author | Michael Vogt <egon@bottom> | 2006-07-26 16:13:02 +0200 |
---|---|---|
committer | Michael Vogt <egon@bottom> | 2006-07-26 16:13:02 +0200 |
commit | 961c7214468e3fce4deb432d3a0b31b2510aaafe (patch) | |
tree | d10fab8cffdf97d5efcd85a503e4906771c39c5e /ftparchive/cachedb.cc | |
parent | b28fffc2825b807a26513f2ac5f34cb6e064acbf (diff) | |
parent | 4577fda2b5f2b21f5400d10f4db71a8095f0df58 (diff) |
* merged with mainline
Diffstat (limited to 'ftparchive/cachedb.cc')
-rw-r--r-- | ftparchive/cachedb.cc | 13 |
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; } } |