diff options
author | Pablo Barciela <[email protected]> | 2019-07-13 16:35:15 +0200 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2019-07-17 20:23:38 +0200 |
commit | 0ccbae1718790d92aa84f9d3cf9962bc7f0e02ad (patch) | |
tree | 356ec3e835092587044bc99ea512df0c94d348e7 | |
parent | ef690901c878b3e89bacd53254fa86d22f83969b (diff) | |
download | engrampa-0ccbae1718790d92aa84f9d3cf9962bc7f0e02ad.tar.bz2 engrampa-0ccbae1718790d92aa84f9d3cf9962bc7f0e02ad.tar.xz |
fr-command-unarchiver: ask password if required
-rw-r--r-- | src/fr-command-unarchiver.c | 14 |
1 files 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; + } } } } |