[gnome-autoar/gnome-3-22] AutoarExtractor: treat missing case in destination suggestion process



commit 029bd0e228bdcd3de56d52dda1cd2ba7d25b623f
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Wed Oct 26 11:36:03 2016 +0300

    AutoarExtractor: treat missing case in destination suggestion process
    
    The case of archives having the name of the root element with the format
    extension (for example 'sample.odt' in 'sample.odt.zip') was not treated. This
    lead to unnecessary folders being created. In order to fix this, check if the
    archive's name without extension is the same as the root element's name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773520

 gnome-autoar/autoar-extractor.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index b42b9cd..31f3449 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -1686,7 +1686,8 @@ autoar_extractor_step_set_destination (AutoarExtractor *self)
     prefix_name = g_file_get_basename (self->prefix);
     prefix_name_no_ext = autoar_common_get_basename_remove_extension (prefix_name);
 
-    if (g_strcmp0 (prefix_name_no_ext, self->suggested_destname) == 0) {
+    if (g_strcmp0 (prefix_name, self->suggested_destname) == 0 ||
+        g_strcmp0 (prefix_name_no_ext, self->suggested_destname) == 0) {
       self->destination_dir = g_object_ref (self->output_file);
     } else {
       g_clear_object (&self->prefix);


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