summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-07-13 16:35:15 +0200
committerZenWalker <[email protected]>2019-07-17 20:16:44 +0200
commit1c71dc58c705a521e83ffc65383b6f4d3ddc26b2 (patch)
treec1a27fd4bb35a13a99f29bd50f5e690868fbb904
parentd1b96db74aadd004bcef21a9144d171ba272befb (diff)
downloadengrampa-1c71dc58c705a521e83ffc65383b6f4d3ddc26b2.tar.bz2
engrampa-1c71dc58c705a521e83ffc65383b6f4d3ddc26b2.tar.xz
fr-command-unarchiver: ask password if required
-rw-r--r--src/fr-command-unarchiver.c14
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;
+ }
}
}
}