Fix bug #3055480: properly compare URLs, instead of erroneously assuming that strcasecmp is the correct answer.

svn path=/trunk/netsurf/; revision=10721
This commit is contained in:
John Mark Bell 2010-08-29 17:41:54 +00:00
parent af36d00066
commit 78f3bbaed3
1 changed files with 6 additions and 2 deletions

View File

@ -695,9 +695,13 @@ nserror llcache_object_retrieve_from_cache(const char *url, uint32_t flags,
/* Search for the most recently fetched matching object */
for (obj = llcache_cached_objects; obj != NULL; obj = obj->next) {
if (strcasecmp(obj->url, url) == 0 && (newest == NULL ||
obj->cache.req_time > newest->cache.req_time))
bool match;
if (url_compare(obj->url, url, true, &match) == URL_FUNC_OK &&
match == true && (newest == NULL ||
obj->cache.req_time > newest->cache.req_time)) {
newest = obj;
}
}
if (newest != NULL && llcache_object_is_fresh(newest)) {