summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorMike Engber <engber@src.gnome.org>2000-10-26 18:12:35 +0000
committerMike Engber <engber@src.gnome.org>2000-10-26 18:12:35 +0000
commit2d9d9d12db63fe5b0b7f08d8206ccf0ae05928c5 (patch)
tree1365ca903667999c369d6114d98a455682db2eaf /libnautilus-private
parent247559c2f73891552cd48e079be35715a03556e4 (diff)
downloadnautilus-2d9d9d12db63fe5b0b7f08d8206ccf0ae05928c5.tar.gz
Link names weren't properly escaped causing them not to get selected.
* libnautilus-extensions/nautilus-file-operations.c: (get_link_name), (make_next_duplicate_name): Link names weren't properly escaped causing them not to get selected. * src/file-manager/fm-directory-view.c: (copy_move_done_callback), (new_folder_done), (fm_directory_view_trash_state_changed_callback): added asserts
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-file-operations.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 3bb438eaf..6ee837484 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -519,11 +519,17 @@ handle_xfer_overwrite (const GnomeVFSXferProgressInfo *progress_info,
static char *
get_link_name (char *name, int count)
{
- const char *format;
char *result;
+ char *unescaped_name;
+ char *unescaped_result;
+
+ const char *format;
g_assert (name != NULL);
+ unescaped_name = gnome_vfs_unescape_string (name, "/");
+ g_free (name);
+
if (count < 1) {
g_warning ("bad count in get_link_name");
count = 1;
@@ -544,7 +550,7 @@ get_link_name (char *name, int count)
format = _("another link to %s");
break;
}
- result = g_strdup_printf (format, name);
+ unescaped_result = g_strdup_printf (format, unescaped_name);
} else {
/* Handle special cases for the first few numbers of each ten.
@@ -569,10 +575,14 @@ get_link_name (char *name, int count)
format = _("%dth link to %s");
break;
}
- result = g_strdup_printf (format, count, name);
+ unescaped_result = g_strdup_printf (format, count, unescaped_name);
}
- g_free (name);
+ result = gnome_vfs_escape_path_string (unescaped_result);
+
+ g_free (unescaped_name);
+ g_free (unescaped_result);
+
return result;
}
@@ -582,7 +592,7 @@ get_link_name (char *name, int count)
*/
#define COPY_DUPLICATE_TAG _(" (copy)")
-#define FRIST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
+#define FIRST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
#define ANOTHER_COPY_DUPLICATE_TAG _(" (another copy)")
#define SECOND_COPY_DUPLICATE_FORMAT _("%s (another copy)%s")
@@ -721,7 +731,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count)
g_assert_not_reached ();
/* fall through */
case 1:
- format = FRIST_COPY_DUPLICATE_FORMAT;
+ format = FIRST_COPY_DUPLICATE_FORMAT;
break;
case 2:
format = SECOND_COPY_DUPLICATE_FORMAT;