diff options
author | ZenWalker <[email protected]> | 2016-09-04 02:51:00 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2016-09-04 02:51:00 +0200 |
commit | 2797019b5e872d7cd9ad368d0188ee42f228caa8 (patch) | |
tree | 6e072d2dc88ba5899c74420b66dfa8ca67443773 | |
parent | dd3529f648ba643924b94857fe16afd37147788d (diff) | |
download | engrampa-2797019b5e872d7cd9ad368d0188ee42f228caa8.tar.bz2 engrampa-2797019b5e872d7cd9ad368d0188ee42f228caa8.tar.xz |
p7zip: ignore the error "Unexpected end of archive"
Fixes #128
-rw-r--r-- | src/fr-command-7z.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index a7d032e..f2d6020 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -39,7 +39,8 @@ 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; +static gboolean spd_support = FALSE; +static gboolean unexpected_end_of_archive = FALSE; /* Parent Class */ @@ -125,6 +126,9 @@ list__process_line (char *line, comm->multi_volume = (strcmp (fields[1], "+") == 0); g_strfreev (fields); } + else if (strncmp (line, "Unexpected end of archive", 25) == 0) { + unexpected_end_of_archive = TRUE; + } return; } @@ -486,6 +490,8 @@ fr_command_7z_extract (FrCommand *comm, if (!g_str_has_prefix (scan->data, "@")) fr_process_add_arg (comm->process, scan->data); + if (unexpected_end_of_archive) fr_process_set_ignore_error (comm->process, TRUE); + fr_process_end_command (comm->process); } @@ -534,7 +540,7 @@ fr_command_7z_handle_error (FrCommand *comm, return; } - if (error->status <= 1) { + if ((error->status <= 1) || (unexpected_end_of_archive)) { error->type = FR_PROC_ERROR_NONE; } else { |