[gparted] Repair broken volume label regular expression pattern
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Repair broken volume label regular expression pattern
- Date: Tue, 1 Nov 2011 19:09:49 +0000 (UTC)
commit 71c1606cac74782db50b6bb27cdf821b2393c82d
Author: Curtis Gedak <gedakc gmail com>
Date: Tue Nov 1 12:45:14 2011 -0600
Repair broken volume label regular expression pattern
Also adjust indentation.
src/btrfs.cc | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/btrfs.cc b/src/btrfs.cc
index f7aede5..e779402 100644
--- a/src/btrfs.cc
+++ b/src/btrfs.cc
@@ -190,19 +190,18 @@ bool btrfs::resize( const Partition & partition_new, OperationDetail & operation
void btrfs::read_label( Partition & partition )
{
- if ( ! Utils::execute_command( "btrfs-show " + partition .get_path(), output, error, true ) )
- {
- partition .label = Utils::regexp_label( output, "^Label ([^\n\t]*)" ) ;
- }
- else
- {
- if ( ! output .empty() )
- partition .messages .push_back( output ) ;
-
- if ( ! error .empty() )
- partition .messages .push_back( error ) ;
- }
+ if ( ! Utils::execute_command( "btrfs-show " + partition .get_path(), output, error, true ) )
+ {
+ partition .label = Utils::regexp_label( output, "^Label:?\\s*([^\n\t]*)\\s*uuid:" ) ;
+ }
+ else
+ {
+ if ( ! output .empty() )
+ partition .messages .push_back( output ) ;
+ if ( ! error .empty() )
+ partition .messages .push_back( error ) ;
+ }
}
} //GParted
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]