aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-url-scanner.c45
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;