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




commit 15ca2a26467a0c4ddb67d7d88f9f504f1a3d9e33
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 a6ab32905..f608c2962 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]