Don't hard code reiser4 max label length when reading the label
Lookup the maximum reiser4 file system label length instead, so that it
is defined in only one place. Small improvement missed from earlier
commit:
18941e24d3
Avoid reading trailing junk for a reiser4 label (#689318)
This commit is contained in:
parent
e218ba3358
commit
a39079211b
|
@ -96,10 +96,11 @@ void reiser4::read_label( Partition & partition )
|
|||
{
|
||||
if ( ! Utils::execute_command( "debugfs.reiser4 " + partition .get_path(), output, error, true ) )
|
||||
{
|
||||
Glib::ustring::size_type maxlen = Utils::get_filesystem_label_maxlength( FS_REISER4 ) ;
|
||||
Glib::ustring label = Utils::regexp_label( output, "^label:[[:blank:]]*(.*)$" ) ;
|
||||
//Avoid reading any trailing junk after the label
|
||||
if ( label .length() > 16 )
|
||||
label .resize( 16 ) ;
|
||||
if ( label .length() > maxlen )
|
||||
label .resize( maxlen ) ;
|
||||
if ( label != "<none>" )
|
||||
partition .set_label( label ) ;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue