From 657e384a8482f6bd42ef4b021180b79bb0f0110c Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 22 Feb 2007 11:48:39 +0000 Subject: Fix RING_FINDBYHOST to actually find things. jmb found the bug, I verified his patch and committed it svn path=/trunk/netsurf/; revision=3186 --- content/fetch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'content/fetch.c') diff --git a/content/fetch.c b/content/fetch.c index 9ec4595cf..558b96fc0 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -168,13 +168,16 @@ static int fetch_cert_verify_callback(X509_STORE_CTX *x509_ctx, void *parm); #define RING_FINDBYHOST(ring, element, hostname) \ LOG(("RING_FINDBYHOST(%s, %s)", #ring, hostname)); \ if (ring) { \ + bool found = false; \ element = ring; \ do { \ - if (strcasecmp(element->host, hostname) == 0) \ + if (strcasecmp(element->host, hostname) == 0) { \ + found = true; \ break; \ + } \ element = element->r_next; \ } while (element != ring); \ - element = 0; \ + if (!found) element = 0; \ } else element = 0 /** Measure the size of a ring and put it in the supplied variable */ -- cgit v1.2.3