From ab704ba7a75be135717f71028a64185501ec0934 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Sat, 4 Dec 2010 22:46:33 +0000 Subject: Make urldb_add_url IPv6-aware svn path=/trunk/netsurf/; revision=10990 --- content/urldb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'content/urldb.c') diff --git a/content/urldb.c b/content/urldb.c index ee550503f..6ba56f41e 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -791,12 +791,13 @@ bool urldb_add_url(const char *url) host++; /* get port and remove from host */ - colon = strrchr(host, ':'); - if (!colon) { - port = 0; - } else { - *colon = '\0'; - port = atoi(colon + 1); + port = 0; + if (host[strlen(host)] != ']') { + colon = strrchr(host, ':'); + if (colon) { + *colon = '\0'; + port = atoi(colon + 1); + } } /* Get host entry */ -- cgit v1.2.3