diff options
Diffstat (limited to 'src/gmutil.c')
-rw-r--r-- | src/gmutil.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gmutil.c b/src/gmutil.c index 04621e54..691260dc 100644 --- a/src/gmutil.c +++ b/src/gmutil.c | |||
@@ -41,7 +41,9 @@ void init_Url(iUrl *d, const iString *text) { | |||
41 | urlPattern_ = new_RegExp("^(([^:/?#]+):)?(//([^/?#]*))?" | 41 | urlPattern_ = new_RegExp("^(([^:/?#]+):)?(//([^/?#]*))?" |
42 | "([^?#]*)(\\?([^#]*))?(#(.*))?", | 42 | "([^?#]*)(\\?([^#]*))?(#(.*))?", |
43 | caseInsensitive_RegExpOption); | 43 | caseInsensitive_RegExpOption); |
44 | authPattern_ = new_RegExp("([^:]+)(:([0-9]+))?", caseInsensitive_RegExpOption); | 44 | authPattern_ = new_RegExp("(([^@]+)@)?(([^:\\[\\]]+)" |
45 | "|(\\[[0-9a-f:]+\\]))(:([0-9]+))?", | ||
46 | caseInsensitive_RegExpOption); | ||
45 | } | 47 | } |
46 | iZap(*d); | 48 | iZap(*d); |
47 | iRegExpMatch m; | 49 | iRegExpMatch m; |
@@ -55,8 +57,8 @@ void init_Url(iUrl *d, const iString *text) { | |||
55 | /* Check if the authority contains a port. */ | 57 | /* Check if the authority contains a port. */ |
56 | init_RegExpMatch(&m); | 58 | init_RegExpMatch(&m); |
57 | if (matchRange_RegExp(authPattern_, d->host, &m)) { | 59 | if (matchRange_RegExp(authPattern_, d->host, &m)) { |
58 | d->host = capturedRange_RegExpMatch(&m, 1); | 60 | d->host = capturedRange_RegExpMatch(&m, 3); |
59 | d->port = capturedRange_RegExpMatch(&m, 3); | 61 | d->port = capturedRange_RegExpMatch(&m, 7); |
60 | } | 62 | } |
61 | } | 63 | } |
62 | } | 64 | } |