Commit 1197a521 authored by Rogier Goossens's avatar Rogier Goossens Committed by Curtis Gedak
Browse files

New partition dialog: first filesystem in list is always included

Even if invalid, the first filesystem in list is always included.

This is an off-by-one error, which was triggered when the first member
of FILESYSTEMS was no longer a regular filesystem, as a result of
commit ce9feeda:
'Make FileSystem objects in GParted_Core accessible and usable by others'
parent 387feb14
......@@ -46,13 +46,15 @@ void Dialog_Partition_New::Set_Data( const Partition & partition,
this ->FILESYSTEMS = FILESYSTEMS ;
//remove all non-valid file systems
for ( unsigned int t = this ->FILESYSTEMS .size( ) ; t > 0 ; t-- )
std::vector< FS >::iterator f ;
for ( f = this->FILESYSTEMS .begin(); f != this->FILESYSTEMS .end(); f++ )
{
if ( this ->FILESYSTEMS[ t ] .filesystem == GParted::FS_UNKNOWN ||
this ->FILESYSTEMS[ t ] .filesystem == GParted::FS_LVM2_PV ||
this ->FILESYSTEMS[ t ] .filesystem == GParted::FS_LUKS
if ( f ->filesystem == GParted::FS_UNKNOWN
|| f ->filesystem == GParted::FS_LVM2_PV
|| f ->filesystem == GParted::FS_LUKS
)
this ->FILESYSTEMS .erase( this->FILESYSTEMS .begin() + t ) ;
//Compensate for subsequent 'f++' ...
f = this ->FILESYSTEMS .erase( f ) - 1 ;
}
FS fs_tmp ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment