diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-06-25 23:09:21 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-25 23:09:21 +0800 |
commit | 46d1d136e72c69b62f09b8523c437576f8d2051c (patch) | |
tree | 7cdc715c2b6483257c52745272d82873012f1e88 /camel | |
parent | ead0633d3ba2685b2311a26afc66aaa660666688 (diff) | |
download | gsoc2013-evolution-46d1d136e72c69b62f09b8523c437576f8d2051c.tar.gz gsoc2013-evolution-46d1d136e72c69b62f09b8523c437576f8d2051c.tar.zst gsoc2013-evolution-46d1d136e72c69b62f09b8523c437576f8d2051c.zip |
Fixed to handle :pass in proto://user:pass@host. Fixes bug #60104.
2004-06-25 Jeffrey Stedfast <fejj@novell.com>
* camel-url-scanner.c (camel_url_web_end): Fixed to handle :pass
in proto://user:pass@host. Fixes bug #60104.
svn path=/trunk/; revision=26514
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | camel/camel-url-scanner.c | 45 |
2 files changed, 41 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index e96c83fa6e..7fd7c209c4 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2004-06-25 Jeffrey Stedfast <fejj@novell.com> + + * camel-url-scanner.c (camel_url_web_end): Fixed to handle :pass + in proto://user:pass@host. Fixes bug #60104. + 2004-06-24 Jeffrey Stedfast <fejj@novell.com> * providers/pop3/camel-pop3-store.c (connect_to_server): Error out diff --git a/camel/camel-url-scanner.c b/camel/camel-url-scanner.c index 486b42c34e..466cec3a15 100644 --- a/camel/camel-url-scanner.c +++ b/camel/camel-url-scanner.c @@ -325,6 +325,8 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_ { register const char *inptr = pos; int parts = 0, digits, port; + gboolean passwd = FALSE; + const char *save; char close_brace; inptr += strlen (match->pattern); @@ -351,8 +353,6 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_ } while (parts < 4); } else if (is_atom (*inptr)) { /* might be a domain or user@domain */ - const char *save = inptr; - while (inptr < inend) { if (!is_atom (*inptr)) break; @@ -392,15 +392,42 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_ if (inptr < inend) { switch (*inptr) { - case ':': /* port notation */ + case ':': /* we either have a port or a password */ inptr++; - port = 0; - - while (inptr < inend && is_digit (*inptr) && port < 65536) - port = (port * 10) + (*inptr++ - '0'); - if (port >= 65536) - inptr--; + if (is_digit (*inptr) || passwd) { + port = 0; + + while (inptr < inend && is_digit (*inptr) && port < 65536) + port = (port * 10) + (*inptr++ - '0'); + + if (port >= 65536) { + if (!passwd) { + /* this must be a password? */ + goto passwd; + } + + inptr--; + } + } else { + passwd: + passwd = TRUE; + save = inptr; + + while (inptr < inend && is_atom (*inptr)) + inptr++; + + if (inptr < inend) { + if (*inptr == '@') { + /* there should be a domain next */ + inptr++; + goto domain; + } else { + /* no idea what this is... so don't keep it */ + inptr = save; + } + } + } if (inptr >= inend || *inptr != '/') break; |