** Fix for bug #503662
authorMilan Crha <mcrha@redhat.com>
Tue, 2 Dec 2008 12:27:30 +0000 (12:27 +0000)
committerMilan Crha <mcrha@src.gnome.org>
Tue, 2 Dec 2008 12:27:30 +0000 (12:27 +0000)
2008-12-02  Milan Crha  <mcrha@redhat.com>

** Fix for bug #503662

* libedataserver/e-url.c: (e_uri_new):
Use last '@' in the address part to be the delimiter between
user name and server address, not the first one.

svn path=/trunk/; revision=9789

ChangeLog
libedataserver/e-url.c

index cef4d3d..f12938c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-02  Milan Crha  <mcrha@redhat.com>
+
+       ** Fix for bug #503662
+
+       * libedataserver/e-url.c: (e_uri_new):
+       Use last '@' in the address part to be the delimiter between
+       user name and server address, not the first one.
+
 2008-12-01  Srinivasa Ragavan  <sragavan@novell.com>
 
        * NEWS: Evolution Data Server 2.25.2 release changes
index e7fd522..7a34a59 100644 (file)
@@ -180,6 +180,16 @@ e_uri_new (const char *uri_string)
                slash = uri_string + strcspn (uri_string, "/#");
                at = strchr (uri_string, '@');
                if (at && at < slash) {
+                       const char *at2;
+                       /* this is for cases where username contains '@' at it, like:
+                          http://user@domain.com@server.addr.com/path
+                          We skip all at-s before the slash here. */
+
+                       while (at2 = strchr (at + 1, '@'), at2 && at2 < slash) {
+                               at = at2;
+                       }
+               }
+               if (at && at < slash) {
                        colon = strchr (uri_string, ':');
                        if (colon && colon < at) {
                                uri->passwd = g_strndup (colon + 1, at - colon - 1);