summaryrefslogtreecommitdiff
path: root/src/fr-command-7z.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-01-05 00:24:38 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-07 00:31:27 +0100
commit0bb51e2b85334cd1c1f47c57405d66b01babfae9 (patch)
treebd221ed72d9b77a3c6216991322053e636d092ba /src/fr-command-7z.c
parent0999e4d3295f457b3c37f56b4767c298ee44734a (diff)
downloadengrampa-0bb51e2b85334cd1c1f47c57405d66b01babfae9.tar.bz2
engrampa-0bb51e2b85334cd1c1f47c57405d66b01babfae9.tar.xz
p7zip v9.38 or later with arg -spd Fixes #108
Diffstat (limited to 'src/fr-command-7z.c')
-rw-r--r--src/fr-command-7z.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 0b784f7..316df11 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -39,6 +39,7 @@
static void fr_command_7z_class_init (FrCommand7zClass *class);
static void fr_command_7z_init (FrCommand *afile);
static void fr_command_7z_finalize (GObject *object);
+static gboolean spd_support;
/* Parent Class */
@@ -110,6 +111,10 @@ list__process_line (char *line,
p7z_comm->old_style = TRUE;
else
p7z_comm->old_style = FALSE;
+ if ((strcmp (version, "9.38") < 0) && (ver_len > 1) && (version[1] == '.'))
+ spd_support = FALSE;
+ else
+ spd_support = TRUE;
}
else if (p7z_comm->old_style && (strncmp (line, "Listing archive: ", 17) == 0))
p7z_comm->list_started = TRUE;
@@ -326,6 +331,7 @@ fr_command_7z_add (FrCommand *comm,
fr_process_add_arg (comm->process, "-mem=AES128");
}
+ if (spd_support) fr_process_add_arg (comm->process, "-spd");
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
fr_process_add_arg (comm->process, "-l");
@@ -384,6 +390,7 @@ fr_command_7z_delete (FrCommand *comm,
fr_command_7z_begin_command (comm);
fr_process_add_arg (comm->process, "d");
+ if (spd_support) fr_process_add_arg (comm->process, "-spd");
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
if (is_mime_type (comm->mime_type, "application/x-ms-dos-executable"))
@@ -435,6 +442,7 @@ fr_command_7z_extract (FrCommand *comm,
else
fr_process_add_arg (comm->process, "x");
+ if (spd_support) fr_process_add_arg (comm->process, "-spd");
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
add_password_arg (comm, comm->password, FALSE);