From 0bb51e2b85334cd1c1f47c57405d66b01babfae9 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Tue, 5 Jan 2016 00:24:38 +0100 Subject: p7zip v9.38 or later with arg -spd Fixes #108 --- src/fr-command-7z.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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); -- cgit v1.2.1