From 0ccbae1718790d92aa84f9d3cf9962bc7f0e02ad Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 13 Jul 2019 16:35:15 +0200 Subject: fr-command-unarchiver: ask password if required --- src/fr-command-unarchiver.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fr-command-unarchiver.c b/src/fr-command-unarchiver.c index fc5ed21..5374402 100644 --- a/src/fr-command-unarchiver.c +++ b/src/fr-command-unarchiver.c @@ -237,12 +237,16 @@ fr_command_unarchiver_handle_error (FrCommand *comm, if (error->type == FR_PROC_ERROR_NONE) return; - for (scan = g_list_last (comm->process->err.raw); scan; scan = scan->prev) { - char *line = scan->data; + if (error->type == FR_PROC_ERROR_COMMAND_ERROR) { + for (scan = g_list_last (comm->process->out.raw); scan; scan = scan->prev) { + char *line = scan->data; - if (strstr (line, "password") != NULL) { - error->type = FR_PROC_ERROR_ASK_PASSWORD; - break; + if ((strstr (line, "This archive requires a password to unpack.") != NULL) || + (strstr (line, "Failed! (Missing or wrong password)") != NULL)) { + + error->type = FR_PROC_ERROR_ASK_PASSWORD; + break; + } } } } -- cgit v1.2.1