g_object_get (settings, "text-editor", &text_editor, NULL);
if (text_editor && *text_editor)
- sokoke_spawn_program (text_editor, FALSE, element->fullpath, TRUE);
+ sokoke_spawn_program (text_editor, TRUE, element->fullpath, TRUE);
else
{
gchar* element_uri = g_filename_to_uri (element->fullpath, NULL, NULL);
gchar* real_command;
gchar* command_ready;
- real_command = quote_command ? g_shell_quote (command) : g_strdup (command);
-
/* .desktop files accept %u, %U, %f, %F as URI/ filename, we treat it like %s */
+ real_command = g_strdup (command);
if ((uri_format = strstr (real_command, "%u"))
|| (uri_format = strstr (real_command, "%U"))
|| (uri_format = strstr (real_command, "%f"))
|| (uri_format = strstr (real_command, "%F")))
uri_format[1] = 's';
+
if (strstr (real_command, "%s"))
{
gchar* argument_quoted = quote_argument ? g_shell_quote (argument) : g_strdup (argument);
}
else if (quote_argument)
{
+ gchar* quoted_command = quote_command ? g_shell_quote (real_command) : g_strdup (real_command);
gchar* argument_quoted = g_shell_quote (argument);
- command_ready = g_strconcat (real_command, " ", argument_quoted, NULL);
+ command_ready = g_strconcat (quoted_command, " ", argument_quoted, NULL);
g_free (argument_quoted);
+ g_free (quoted_command);
}
else
- command_ready = g_strconcat (real_command, " ", argument, NULL);
+ {
+ gchar* quoted_command = quote_command ? g_shell_quote (real_command) : g_strdup (real_command);
+ command_ready = g_strconcat (quoted_command, " ", argument, NULL);
+ g_free (quoted_command);
+ }
g_free (real_command);
return command_ready;
}