Commit 35b76688 authored by William Kunkel's avatar William Kunkel Committed by Cosimo Cecchi

Bug 698892 - Replace slashes in dnd'd text

https://bugzilla.gnome.org/show_bug.cgi?id=698892
parent e55e42b1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment