summaryrefslogtreecommitdiff
blob: 53d3dbc18852c46fa315a7ec60cc5977706f94fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Index: plugins/thunar-uca/thunar-uca-editor.c
===================================================================
--- plugins/thunar-uca/thunar-uca-editor.c	(revision 25631)
+++ plugins/thunar-uca/thunar-uca-editor.c	(working copy)
@@ -582,7 +582,13 @@
   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);
+      
+      /* quote the command when the filename contains spaces */
+      if (G_LIKELY (strchr (filename, ' ') == NULL))
+        s = g_strconcat (filename, " %f", NULL);
+      else
+        s = g_strconcat ("'", filename, "' %f", NULL);
+      
       gtk_entry_set_text (GTK_ENTRY (uca_editor->command_entry), s);
       g_free (filename);
       g_free (s);