[gparted] Simplify sscanf("mke2fs ...") text match



commit bfbd324d39def00928c84968162f5d330cc31c48
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri Feb 14 08:02:23 2020 +0000

    Simplify sscanf("mke2fs ...") text match
    
    With removal of support for RHEL / CentOS 5 and it's e4fsprogs package
    [1][2] it is no longer necessary to accept:
        mke4fs 1.41.12 (17-May-2010)
    only:
        mke2fs 1.42.9 (28-Dec-2013)
    
    [1] 6c4ab5dc28a14f3bef2d1c1a24da219381d513f0
        Remove checks for e4fsprogs commands (#794253)
    
    [2] de6e70d933286f3c65187470c9852fb6d8a60a7d
        Simplify ext2::get_filesystem_support() with regard ext4 support (#794253)

 src/ext2.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ext2.cc b/src/ext2.cc
index df86b2ed..00ebb25a 100644
--- a/src/ext2.cc
+++ b/src/ext2.cc
@@ -50,8 +50,8 @@ FS ext2::get_filesystem_support()
                        int mke4fs_major_ver = 0;
                        int mke4fs_minor_ver = 0;
                        int mke4fs_patch_ver = 0;
-                       if ( sscanf( error.c_str(), "mke%*[24]fs %d.%d.%d",
-                                    &mke4fs_major_ver, &mke4fs_minor_ver, &mke4fs_patch_ver ) >= 2 )
+                       if (sscanf(error.c_str(), "mke2fs %d.%d.%d",
+                                  &mke4fs_major_ver, &mke4fs_minor_ver, &mke4fs_patch_ver) >= 2)
                        {
                                // Ext4 64bit feature was added in e2fsprogs 1.42, but
                                // only enable large volumes from 1.42.9 when a large


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