[gparted] Treat reiser4 label "<none>" as meaning blank (#688760)



commit f5c153099b831f5c25a3658a9a67a66ab06d348f
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Tue Nov 20 22:58:41 2012 +0000

    Treat reiser4 label "<none>" as meaning blank (#688760)
    
    A reiser4 file system with a blank label is displayed as "<none>" by
    debugfs.reiser4 and therefore GParted too.
    
        # mkfs.reiser4 -y -L "" -f /dev/sda14
        # debugfs.reiser4 /dev/sda14 2> /dev/null | grep label:
        label:		<none>
    
    Additionally when displaying the Partition Information the following
    warning is written to the terminal:
    
        (gpartedbin:19609): Gtk-WARNING **: Failed to set text from markup
        due to error parsing markup: Error on line 1 char 23: Element
        'markup' was closed, but the currently open element is 'none'
    
    Fix by just assuming "<none>" always means blank.  If someone really
    does set the label to "<none>" it won't be displayed.  This is equlivant
    to how btrfs and nilfs2 are already handled.
    
    Closes bug 688760 - GParted displays blank resier4 label as <none>

 src/reiser4.cc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/reiser4.cc b/src/reiser4.cc
index ed31061..0882468 100644
--- a/src/reiser4.cc
+++ b/src/reiser4.cc
@@ -96,7 +96,11 @@ void reiser4::read_label( Partition & partition )
 {
 	if ( ! Utils::execute_command( "debugfs.reiser4 " + partition .get_path(), output, error, true ) )
 	{
-		partition .set_label( Utils::regexp_label( output, "^label:[[:blank:]]*(.*)$" ) ) ;
+		Glib::ustring label = Utils::regexp_label( output, "^label:[[:blank:]]*(.*)$" ) ;
+		if ( label != "<none>" )
+			partition .set_label( label ) ;
+		else
+			partition .set_label( "" ) ;
 	}
 	else
 	{



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