summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2010-12-04 22:46:33 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2010-12-04 22:46:33 +0000
commitab704ba7a75be135717f71028a64185501ec0934 (patch)
treed1782a8eb4214e9d164ada4dada52af7a12ca70d /content/urldb.c
parent73ace49c5a12b556e873252032d3117152d90a3f (diff)
downloadnetsurf-ab704ba7a75be135717f71028a64185501ec0934.tar.gz
netsurf-ab704ba7a75be135717f71028a64185501ec0934.tar.bz2
Make urldb_add_url IPv6-aware
svn path=/trunk/netsurf/; revision=10990
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c13
1 files changed, 7 insertions, 6 deletions
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 */