summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsc0w <[email protected]>2016-05-21 23:03:39 +0200
committersc0w <[email protected]>2016-05-21 23:03:39 +0200
commit28f01343816e6dd69a80f36947b0ea4297462550 (patch)
tree0c5b2e84dbc2ffe536dc02379f075e84d26b6174 /src
parentec986c2ac62822baaa217a2e1c6e27a0762d4561 (diff)
downloadengrampa-28f01343816e6dd69a80f36947b0ea4297462550.tar.bz2
engrampa-28f01343816e6dd69a80f36947b0ea4297462550.tar.xz
7z: Fixed problems with files prefixed '@'
Fixes #138
Diffstat (limited to 'src')
-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);
}