[nautilus/wip/antoniof/gnome-42: 71/72] file-operations: Call autoar_compressor_set_passphrase conditionally




commit 7d5b4b6f3976d20c5684316cd0d7a3e6fef9da87
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Jan 17 15:50:08 2022 +0100

    file-operations: Call autoar_compressor_set_passphrase conditionally
    
    The `autoar_compressor_set_passphrase` function is always called currently
    regardless the fact whether password is set, or not. Consequently, the
     "autoar_compressor_set_passphrase: assertion 'self->format == AUTOAR_FORMAT_ZIP'
    failed" critical is printed. Let's call that function only if the passphrase is
    really wanted.

 src/nautilus-file-operations.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 54613e086..d358518b2 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -9037,7 +9037,10 @@ compress_task_thread_func (GTask        *task,
                                         compress_job->format,
                                         compress_job->filter,
                                         FALSE);
-    autoar_compressor_set_passphrase (compressor, compress_job->passphrase);
+    if (compress_job->passphrase && compress_job->passphrase[0] != '\0')
+    {
+        autoar_compressor_set_passphrase (compressor, compress_job->passphrase);
+    }
 
     autoar_compressor_set_output_is_dest (compressor, TRUE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]