[gparted] Place options before device name for the ntfsresize command



commit 28d41d0d6a5dcbea0630f63d0c3c5a53892227e3
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Mon May 27 19:53:09 2013 +0100

    Place options before device name for the ntfsresize command
    
    Place the size and noaction options before the device name when resizing
    an NTFS file system to match the order documented in the manual page.
    Example fixed command:
    
        # ntfsresize -P --force --force -s 104857600 --no-action /dev/sda11

 src/ntfs.cc |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/ntfs.cc b/src/ntfs.cc
index d7ca954..b82eddd 100644
--- a/src/ntfs.cc
+++ b/src/ntfs.cc
@@ -193,26 +193,25 @@ bool ntfs::create( const Partition & new_partition, OperationDetail & operationd
 bool ntfs::resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition )
 {
        bool return_value = false ;
-       Glib::ustring str_temp = "ntfsresize -P --force --force " + partition_new .get_path() ;
-       
+       Glib::ustring size = "" ;
        if ( ! fill_partition )
        {
-               str_temp += " -s " ;
-               str_temp += Utils::num_to_str( Utils::round( Utils::sector_to_unit(
+               size = " -s " + Utils::num_to_str( Utils::round( Utils::sector_to_unit(
                                partition_new .get_sector_length(), partition_new .sector_size, UNIT_BYTE ) ) 
) ;
        }
-       
+       Glib::ustring cmd = "ntfsresize -P --force --force" + size ;
+
        //simulation..
        operationdetail .add_child( OperationDetail( _("run simulation") ) ) ;
 
-       if ( ! execute_command( str_temp + " --no-action", operationdetail .get_last_child() ) )
+       if ( ! execute_command( cmd + " --no-action " + partition_new .get_path(), operationdetail 
.get_last_child() ) )
        {
                operationdetail .get_last_child() .set_status( STATUS_SUCCES ) ;
 
                //real resize
                operationdetail .add_child( OperationDetail( _("real resize") ) ) ;
 
-               if ( ! execute_command( str_temp, operationdetail .get_last_child() ) )
+               if ( ! execute_command( cmd + " " + partition_new .get_path(), operationdetail 
.get_last_child() ) )
                {
                        operationdetail .get_last_child() .set_status( STATUS_SUCCES ) ;
                        return_value = true ;


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