diff options
Diffstat (limited to 'camel/camel-url-scanner.c')
-rw-r--r-- | camel/camel-url-scanner.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/camel/camel-url-scanner.c b/camel/camel-url-scanner.c index 49b53518ad..891a47610e 100644 --- a/camel/camel-url-scanner.c +++ b/camel/camel-url-scanner.c @@ -325,35 +325,17 @@ gboolean camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *match) { register const char *inptr = pos; - int parts = 0, digits, port; gboolean passwd = FALSE; const char *save; char close_brace; + int port; inptr += strlen (match->pattern); close_brace = url_stop_at_brace (in, match->um_so); /* find the end of the domain */ - if (is_digit (*inptr)) { - domain_literal: - /* domain-literal */ - do { - digits = 0; - while (inptr < inend && is_digit (*inptr) && digits < 3) { - inptr++; - digits++; - } - - parts++; - - if (*inptr != '.' && parts != 4) - return FALSE; - else if (*inptr == '.') - inptr++; - - } while (parts < 4); - } else if (is_atom (*inptr)) { + if (is_atom (*inptr)) { /* might be a domain or user@domain */ save = inptr; while (inptr < inend) { @@ -404,8 +386,8 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_ while (inptr < inend && is_digit (*inptr) && port < 65536) port = (port * 10) + (*inptr++ - '0'); - if (port >= 65536) { - if (!passwd && inptr < inend) { + if (!passwd && (port >= 65536 || *inptr == '@')) { + if (inptr < inend) { /* this must be a password? */ goto passwd; } @@ -423,9 +405,7 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_ if ((inptr + 2) < inend) { if (*inptr == '@') { inptr++; - if (is_digit (*inptr)) - goto domain_literal; - else if (is_domain (*inptr)) + if (is_domain (*inptr)) goto domain; } |