summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-05-21 23:27:17 +0200
committerZenWalker <[email protected]>2016-05-21 23:27:17 +0200
commit0f5789c9d655363d397de119f3695d3f35be2c04 (patch)
tree0c5b2e84dbc2ffe536dc02379f075e84d26b6174
parentec986c2ac62822baaa217a2e1c6e27a0762d4561 (diff)
parent28f01343816e6dd69a80f36947b0ea4297462550 (diff)
downloadengrampa-0f5789c9d655363d397de119f3695d3f35be2c04.tar.bz2
engrampa-0f5789c9d655363d397de119f3695d3f35be2c04.tar.xz
Merge pull request #139 from sc0w/master
7z: Fixed problems with files prefixed '@'
-rw-r--r--src/fr-command-7z.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 316df11..20cfa2c 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -371,11 +371,20 @@ fr_command_7z_add (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
@@ -399,11 +408,20 @@ fr_command_7z_delete (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
@@ -453,11 +471,20 @@ fr_command_7z_extract (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}