[gparted] Restore ability to grow primary w/unallocated space before extended (#778700)



commit 4a0931c50dbeed08ed1430a72079ebc9ddb4dc45
Author: Curtis Gedak <gedakc gmail com>
Date:   Thu Feb 16 10:10:14 2017 -0700

    Restore ability to grow primary w/unallocated space before extended (#778700)
    
    A regression which prevented growing a primary partition that had
    unallocated space between it and the following extended partition was
    introduced with the following commit:
    
      Create and use general find_extended_partition() function
      aa98107706405fe0a80d4fd1a1ddb0838518ea7f
    
    To fix the regression, restore the logic that checked for a logical
    partition before seeking the index of the extended partition.
    
    Bug 778700 - Unable to grow partition even though unallocated space is
                 adjacent

 src/Win_GParted.cc |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index de68334..d97da3a 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -1783,9 +1783,12 @@ void Win_GParted::activate_resize()
        g_assert( valid_display_partition_ptr( selected_partition_ptr ) );  // Bug: Not pointing at a valid 
display partition object
 
        PartitionVector * display_partitions_ptr = &display_partitions;
-       int index_extended = find_extended_partition( display_partitions );
-       if ( index_extended >= 0 )
-               display_partitions_ptr = &display_partitions[index_extended].logicals;
+       if ( selected_partition_ptr->type == TYPE_LOGICAL )
+       {
+               int index_extended = find_extended_partition( display_partitions );
+               if ( index_extended >= 0 )
+                       display_partitions_ptr = &display_partitions[index_extended].logicals;
+       }
 
        FS fs_cap = gparted_core.get_fs( selected_partition_ptr->get_filesystem_partition().filesystem );
        Partition * working_ptn;


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