The @ in http://foo/bar@baz is part of the path, not the username/hostname
authorDan Winship <danw@src.gnome.org>
Wed, 3 Oct 2001 21:31:26 +0000 (21:31 +0000)
committerDan Winship <danw@src.gnome.org>
Wed, 3 Oct 2001 21:31:26 +0000 (21:31 +0000)
* src/libsoup/soup-uri.c (soup_uri_new): The @ in
http://foo/bar@baz is part of the path, not the username/hostname
split.

ChangeLog
libsoup/soup-uri.c

index d06bde6..aee076d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-03  Dan Winship  <danw@ximian.com>
+
+       * src/libsoup/soup-uri.c (soup_uri_new): The @ in
+       http://foo/bar@baz is part of the path, not the username/hostname
+       split.
+
 2001-10-01  Alex Graveley  <alex@ximian.com>
 
        * configure.in: Fix HAVE_OPENSSL and HAVE_NSS checks as these were
index 62d94d8..3529183 100644 (file)
@@ -145,8 +145,9 @@ soup_uri_new (const gchar* uri_string)
        /* If there is an @ sign, look for user, authmech, and
         * password before it.
         */
+       slash = strchr (uri_string, '/');
        at = strchr (uri_string, '@');
-       if (at) {
+       if (at && (!slash || at < slash)) {
                colon = strchr (uri_string, ':');
                if (colon && colon < at)
                        g_uri->passwd = g_strndup (colon + 1, at - colon - 1);
@@ -170,7 +171,6 @@ soup_uri_new (const gchar* uri_string)
                g_uri->user = g_uri->passwd = g_uri->authmech = NULL;
 
        /* Find host (required) and port. */
-       slash = strchr (uri_string, '/');
        colon = strchr (uri_string, ':');
        if (slash && colon > slash)
                colon = 0;