summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2007-02-22 11:48:39 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2007-02-22 11:48:39 +0000
commit657e384a8482f6bd42ef4b021180b79bb0f0110c (patch)
treea53b2c14ac650f2061eadfde416450a31693760a
parentd3718bd4a78532b1559389058d17206916535c23 (diff)
downloadnetsurf-657e384a8482f6bd42ef4b021180b79bb0f0110c.tar.gz
netsurf-657e384a8482f6bd42ef4b021180b79bb0f0110c.tar.bz2
Fix RING_FINDBYHOST to actually find things. jmb found the bug, I verified his patch and committed it
svn path=/trunk/netsurf/; revision=3186
-rw-r--r--content/fetch.c7
1 files changed, 5 insertions, 2 deletions
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 */