diff -ur Thunar-0.8.0_original/plugins/thunar-uca/thunar-uca-editor.c Thunar-0.8.0/plugins/thunar-uca/thunar-uca-editor.c --- Thunar-0.8.0_original/plugins/thunar-uca/thunar-uca-editor.c 2007-01-20 21:39:07.000000000 +0100 +++ Thunar-0.8.0/plugins/thunar-uca/thunar-uca-editor.c 2007-04-08 21:49:52.071721738 +0200 @@ -484,6 +484,7 @@ GtkWidget *chooser; gchar *filename; gchar *s; + gchar *safe_filename; g_return_if_fail (THUNAR_UCA_IS_EDITOR (uca_editor)); @@ -582,9 +583,18 @@ if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT) { filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); - s = g_strconcat (filename, " %f", NULL); + /* Bug 3105: Add quotes, if the path to filename contains spaces */ + if (strstr (filename, " ") == NULL) + /* No spaces in filename, it's safe to use the filename as it is */ + safe_filename = g_strdup(filename); + else + /* filename contains spaces, add quotes */ + safe_filename = g_strdup_printf ("\"%s\"", filename); + + s = g_strconcat (safe_filename, " %f", NULL); gtk_entry_set_text (GTK_ENTRY (uca_editor->command_entry), s); g_free (filename); + g_free (safe_filename); g_free (s); }