summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-file-utilities.c
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-09-29 22:18:25 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-09-29 22:18:25 +0000
commit7715f09b233460428a6fcb115c8ccd3ffc9a391e (patch)
tree93f930133a122d9114d22dc66150f16e389ffaf4 /libnautilus-private/nautilus-file-utilities.c
parentfb80ae13765036bccf9e151cc3d951101918de12 (diff)
downloadnautilus-7715f09b233460428a6fcb115c8ccd3ffc9a391e.tar.gz
Fixed bug 3322 (context menus don't work in FTP site
that wasn't typed with a trailing slash) * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_make_uri_canonical): New function, calls nautilus_make_uri_canonical and then strips off the trailing slash if any. (nautilus_directory_get_internal): Call this new slightly stricter function instead of nautilus_make_uri_canonical, to guarantee that we'll never get two NautilusDirectory objects for uris that match other than the trailing slash. (nautilus_self_check_directory): Add test cases for new function. * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_make_uri_canonical): Removed #if 0 code whose equivalent is now in the NautilusDirectory version, replaced with comment.
Diffstat (limited to 'libnautilus-private/nautilus-file-utilities.c')
-rw-r--r--libnautilus-private/nautilus-file-utilities.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c
index 73ca09412..cac678f0c 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -272,25 +272,15 @@ nautilus_make_uri_canonical (const char *uri)
*/
canonical_uri = nautilus_handle_trailing_slashes (uri);
-#if 0
- char *with_slashes;
- size_t length;
- /* Strip the trailing "/" characters. */
- canonical_uri = nautilus_str_strip_trailing_chr (uri, '/');
- if (strcmp (canonical_uri, uri) != 0) {
- /* If some trailing '/' were stripped, there's the possibility,
- * that we stripped away all the '/' from a uri that has only
- * '/' characters. If you change this code, check to make sure
- * that "file:///" still works as a URI.
- */
- length = strlen (canonical_uri);
- if (length == 0 || canonical_uri[length - 1] == ':') {
- with_slashes = g_strconcat (canonical_uri, "///", NULL);
- g_free (canonical_uri);
- canonical_uri = with_slashes;
- }
- }
-#endif
+
+ /* Note: In some cases, a trailing slash means nothing, and can
+ * be considered equivalent to no trailing slash. But this is
+ * not true in every case; specifically not for web addresses passed
+ * to a web-browser. So we don't have the trailing-slash-equivalence
+ * logic here, but we do use that logic in NautilusDirectory where
+ * the rules are more strict.
+ */
+
/* Add file: if there is no scheme. */
if (strchr (canonical_uri, ':') == NULL) {
old_uri = canonical_uri;