Skip to content

Commit

Permalink
nemo-view.c: unescape uris being passed to file-roller during
Browse files Browse the repository at this point in the history
drag-and-drop (replaces %20 with spaces).

Fixes #1237
  • Loading branch information
mtwebster committed Aug 22, 2016
1 parent d285f17 commit 2a1084a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/nemo-view.c
Expand Up @@ -10653,26 +10653,32 @@ nemo_view_move_copy_items (NemoView *view,
nemo_is_file_roller_installed () &&
target_file != NULL &&
nemo_file_is_archive (target_file)) {
char *command, *quoted_uri, *tmp;
char *command, *quoted_uri, *unescaped, *tmp;
const GList *l;
GdkScreen *screen;

/* Handle dropping onto a file-roller archiver file, instead of starting a move/copy */

nemo_file_unref (target_file);

quoted_uri = g_shell_quote (target_uri);
unescaped = g_uri_unescape_string (target_uri, "");
quoted_uri = g_shell_quote (unescaped);

command = g_strconcat ("file-roller -a ", quoted_uri, NULL);
g_free (quoted_uri);

g_clear_pointer (&quoted_uri, g_free);
g_clear_pointer (&unescaped, g_free);

for (l = item_uris; l != NULL; l = l->next) {
quoted_uri = g_shell_quote ((char *) l->data);
unescaped = g_uri_unescape_string ((char *) l->data, "");
quoted_uri = g_shell_quote (unescaped);

tmp = g_strconcat (command, " ", quoted_uri, NULL);
g_free (command);
command = tmp;

g_free (quoted_uri);
g_clear_pointer (&quoted_uri, g_free);
g_clear_pointer (&unescaped, g_free);
}

screen = gtk_widget_get_screen (GTK_WIDGET (view));
Expand Down

0 comments on commit 2a1084a

Please sign in to comment.