From f5c153099b831f5c25a3658a9a67a66ab06d348f Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Tue, 20 Nov 2012 22:58:41 +0000 Subject: [PATCH] Treat reiser4 label "" as meaning blank (#688760) A reiser4 file system with a blank label is displayed as "" by debugfs.reiser4 and therefore GParted too. # mkfs.reiser4 -y -L "" -f /dev/sda14 # debugfs.reiser4 /dev/sda14 2> /dev/null | grep label: label: 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 "" always means blank. If someone really does set the label to "" 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 --- src/reiser4.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/reiser4.cc b/src/reiser4.cc index ed31061b..08824688 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 != "" ) + partition .set_label( label ) ; + else + partition .set_label( "" ) ; } else {