[gparted] Don't hard code reiser4 max label length when reading the label
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Don't hard code reiser4 max label length when reading the label
- Date: Mon, 25 Mar 2013 16:59:20 +0000 (UTC)
commit a39079211b9726dffe727572f47cb7a5ce7d48b6
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Sat Feb 23 22:57:54 2013 +0000
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:
18941e24d3cb0b97a6d7cf52800f8f506f6a9ba8
Avoid reading trailing junk for a reiser4 label (#689318)
src/reiser4.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/reiser4.cc b/src/reiser4.cc
index de9601d..9c3d4c1 100644
--- a/src/reiser4.cc
+++ b/src/reiser4.cc
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]