summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-17 09:59:04 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-17 09:59:04 +0300
commit927a64c9c50f3ce5cf8285ce3ee1dc9f2985d746 (patch)
treec70bf90bbc6950c0a71b7410507a8efda6b497d3 /src
parenta7877bb6b16bcca855768956bfc269e1ffedfe94 (diff)
Parsing an IPv6 URL
The brackets are part of the URL notation and should not be considered part of the IPv6 address itself.
Diffstat (limited to 'src')
-rw-r--r--src/gmutil.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gmutil.c b/src/gmutil.c
index df77a3e0..34132015 100644
--- a/src/gmutil.c
+++ b/src/gmutil.c
@@ -61,6 +61,11 @@ void init_Url(iUrl *d, const iString *text) {
61 d->host = capturedRange_RegExpMatch(&m, 3); 61 d->host = capturedRange_RegExpMatch(&m, 3);
62 d->port = capturedRange_RegExpMatch(&m, 7); 62 d->port = capturedRange_RegExpMatch(&m, 7);
63 } 63 }
64 /* Remove brackets from an IPv6 literal. */
65 if (size_Range(&d->host) > 2 && d->host.start[0] == '[' && d->host.end[-1] == ']') {
66 d->host.start++;
67 d->host.end--;
68 }
64 } 69 }
65} 70}
66 71