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

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 */ /* Search for the most recently fetched matching object */
for (obj = llcache_cached_objects; obj != NULL; obj = obj->next) { for (obj = llcache_cached_objects; obj != NULL; obj = obj->next) {
if (strcasecmp(obj->url, url) == 0 && (newest == NULL || bool match;
obj->cache.req_time > newest->cache.req_time))
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; newest = obj;
}
} }
if (newest != NULL && llcache_object_is_fresh(newest)) { if (newest != NULL && llcache_object_is_fresh(newest)) {