From 35b76688d9842134ade30579dfa69f62981377d3 Mon Sep 17 00:00:00 2001 From: William Kunkel Date: Wed, 24 Jul 2013 22:51:56 -0400 Subject: Bug 698892 - Replace slashes in dnd'd text https://bugzilla.gnome.org/show_bug.cgi?id=698892 --- src/nautilus-view-dnd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/nautilus-view-dnd.c b/src/nautilus-view-dnd.c index fbae954de..05f4a858e 100644 --- a/src/nautilus-view-dnd.c +++ b/src/nautilus-view-dnd.c @@ -352,6 +352,7 @@ get_drop_filename (const char *text) int last_nonspace = -1; int num_attrs; PangoLogAttr *attrs; + gchar *current_char; num_attrs = MIN (g_utf8_strlen (text, -1) + 1, MAX_LEN_FILENAME); attrs = g_new (PangoLogAttr, num_attrs); @@ -383,6 +384,15 @@ get_drop_filename (const char *text) filename = g_strdup (_("Dropped Text.txt")); } + /* Remove any invalid characters */ + for (current_char = filename; + *current_char; + current_char = g_utf8_next_char (current_char)) { + if ( G_IS_DIR_SEPARATOR ( g_utf8_get_char (current_char))) { + *current_char = '-'; + } + } + return filename; } -- cgit v1.2.1