[nautilus/wip/oholy/compress-dialog-dropdown: 16/17] file-operations: Call autoar_compressor_set_passphrase conditionally




commit 00d5efd8ea5298b3ae885c82256ec58f230dcfc4
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 38be3fe3a..f07d5ef10 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -9030,7 +9030,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]