- Fix crash after refresh bug (Bug #309251, Fix by Jim Hayward)
- Fix to use realpath properly (Bug #313281, Fix by Jim Hayward)epel8
parent
6bd99b6c6a
commit
14d37b749a
@ -0,0 +1,28 @@
|
||||
--- src/GParted_Core.cc 2006-12-05 14:39:31.000000000 -0500
|
||||
+++ src/GParted_Core.cc.new 2007-10-30 00:29:11.000000000 -0400
|
||||
@@ -487,12 +487,15 @@
|
||||
while ( getline( proc_partitions, line ) )
|
||||
if ( sscanf( line .c_str(), "%*d %*d %*d %255s", c_str ) == 1 )
|
||||
{
|
||||
+ char *real_path = NULL;
|
||||
+
|
||||
line = "/dev/" ;
|
||||
line += c_str ;
|
||||
|
||||
//FIXME: it seems realpath is very unsafe to use (manpage)...
|
||||
+ real_path = realpath( line .c_str(), NULL ) ;
|
||||
if ( file_test( line, Glib::FILE_TEST_EXISTS ) &&
|
||||
- realpath( line .c_str(), c_str ) &&
|
||||
+ real_path &&
|
||||
line != c_str )
|
||||
{
|
||||
//because we can make no assumption about which path libparted will detect
|
||||
@@ -500,6 +503,8 @@
|
||||
alternate_paths[ c_str ] = line ;
|
||||
alternate_paths[ line ] = c_str ;
|
||||
}
|
||||
+ if ( real_path )
|
||||
+ free( real_path ) ;
|
||||
}
|
||||
|
||||
proc_partitions .close() ;
|
@ -0,0 +1,38 @@
|
||||
--- include/Win_GParted.h 2006-11-25 09:56:30.000000000 -0500
|
||||
+++ include/Win_GParted.h.new 2007-10-30 00:37:29.000000000 -0400
|
||||
@@ -233,6 +233,7 @@
|
||||
unsigned short new_count;//new_count keeps track of the new created partitions
|
||||
FS fs ;
|
||||
bool OPERATIONSLIST_OPEN ;
|
||||
+ sigc::connection combo_devices_signal_changed_id ;
|
||||
|
||||
GParted_Core gparted_core ;
|
||||
std::vector<Gtk::Label *> device_info ;
|
||||
--- src/Win_GParted.cc 2006-12-01 08:14:23.000000000 -0500
|
||||
+++ src/Win_GParted.cc.new 2007-10-30 00:35:47.000000000 -0400
|
||||
@@ -260,7 +260,8 @@
|
||||
combo_devices .pack_start( treeview_devices_columns .device ) ;
|
||||
combo_devices .pack_start( treeview_devices_columns .size, false ) ;
|
||||
|
||||
- combo_devices .signal_changed() .connect( sigc::mem_fun(*this, &Win_GParted::combo_devices_changed) );
|
||||
+ combo_devices_signal_changed_id =
|
||||
+ combo_devices .signal_changed() .connect( sigc::mem_fun(*this, &Win_GParted::combo_devices_changed) );
|
||||
|
||||
hbox_toolbar .pack_start( combo_devices, Gtk::PACK_SHRINK ) ;
|
||||
}
|
||||
@@ -502,6 +503,7 @@
|
||||
|
||||
void Win_GParted::refresh_combo_devices()
|
||||
{
|
||||
+ combo_devices_signal_changed_id .block() ;
|
||||
liststore_devices ->clear() ;
|
||||
|
||||
menu = manage( new Gtk::Menu() ) ;
|
||||
@@ -538,6 +540,7 @@
|
||||
menubar_main .items()[ 0 ] .get_submenu() ->items()[ 1 ] .set_submenu( *menu ) ;
|
||||
}
|
||||
|
||||
+ combo_devices_signal_changed_id .unblock() ;
|
||||
combo_devices .set_active( current_device ) ;
|
||||
}
|
||||
|
Loading…
Reference in new issue