diff --git a/ChangeLog b/ChangeLog index 991091fba..28770577b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-08-02 Seth Nickell + + * libnautilus-extensions/nautilus-file-utilities.c: + (nautilus_make_uri_from_input): + Add escaping code to the location bar. + 2000-08-02 Michael Engber * src/nautilus-application.c: (nautilus_application_startup), @@ -14,6 +20,7 @@ 2 new corba calls for nautilus shell, one for starting the desktop and one for quitting. +>>>>>>> 1.1212 2000-08-02 John Sullivan Fixed bug 1877 (Customize window doesn't come to front if diff --git a/libnautilus-extensions/nautilus-file-utilities.c b/libnautilus-extensions/nautilus-file-utilities.c index 3f78fccfe..9bdbb6a16 100644 --- a/libnautilus-extensions/nautilus-file-utilities.c +++ b/libnautilus-extensions/nautilus-file-utilities.c @@ -110,13 +110,28 @@ nautilus_format_uri_for_display (const char *uri) char * nautilus_make_uri_from_input (const char *location) { - gchar *toreturn; + char *toreturn, *escaped; + const char *no_method; + int method_length; - /* FIXME: add escaping logic to this function */ if (location[0] == '/') { - toreturn = g_strconcat (DEFAULT_SCHEME, location, NULL); + escaped = gnome_vfs_escape_path_string (location); + toreturn = g_strconcat (DEFAULT_SCHEME, escaped, NULL); + g_free (escaped); } else { - toreturn = strdup (location); + no_method = strchr (location, ':'); + if (no_method == NULL) { + no_method = location; + } else { + no_method++; + } + + method_length = (no_method - location); + escaped = gnome_vfs_escape_path_string (no_method); + toreturn = g_new (char, strlen (escaped) + method_length + 1); + toreturn[0] = '\0'; + strncat (toreturn, location, method_length); + strcat (toreturn, escaped); } return toreturn; diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c index 3f78fccfe..9bdbb6a16 100644 --- a/libnautilus-private/nautilus-file-utilities.c +++ b/libnautilus-private/nautilus-file-utilities.c @@ -110,13 +110,28 @@ nautilus_format_uri_for_display (const char *uri) char * nautilus_make_uri_from_input (const char *location) { - gchar *toreturn; + char *toreturn, *escaped; + const char *no_method; + int method_length; - /* FIXME: add escaping logic to this function */ if (location[0] == '/') { - toreturn = g_strconcat (DEFAULT_SCHEME, location, NULL); + escaped = gnome_vfs_escape_path_string (location); + toreturn = g_strconcat (DEFAULT_SCHEME, escaped, NULL); + g_free (escaped); } else { - toreturn = strdup (location); + no_method = strchr (location, ':'); + if (no_method == NULL) { + no_method = location; + } else { + no_method++; + } + + method_length = (no_method - location); + escaped = gnome_vfs_escape_path_string (no_method); + toreturn = g_new (char, strlen (escaped) + method_length + 1); + toreturn[0] = '\0'; + strncat (toreturn, location, method_length); + strcat (toreturn, escaped); } return toreturn;