[gparted] Fix recognition of SD/MMC device names (!83)



commit f230ecc7a24536bdc2631d96f6a5ede4a5d7cbfc
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Tue May 18 08:58:50 2021 +0100

    Fix recognition of SD/MMC device names (!83)
    
    User reported that GParted didn't detect their eMMC drive [1].  Not
    recognised device name was /dev/mmcblk0.  Confirmed that the regression
    was introduced by this commit [2].  Fix the code and regular expression
    used to recognise SD/MMC device names.
    
    [1] GParted forum thread: eMMC drive not detected...?
        http://gparted-forum.surf4.info/viewtopic.php?id=17994
    
    [2] 52930f30ae8dc2c9dd1f64d2df654d9f1a1afb8a
        Refactor load_proc_partitions_info_cache() a bit (#131)
    
    Closes !83 - Fix recognition of SD/MMC device names

 src/Proc_Partitions_Info.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/Proc_Partitions_Info.cc b/src/Proc_Partitions_Info.cc
index 5b4facfc..d194d943 100644
--- a/src/Proc_Partitions_Info.cc
+++ b/src/Proc_Partitions_Info.cc
@@ -131,10 +131,11 @@ bool Proc_Partitions_Info::is_whole_disk_device_name(const Glib::ustring& name)
        // Match Linux software RAID (mdadm) device names.
        // E.g.: device = md127 (partition = md127p1)
        if (Utils::regexp_label(name, "^(md[0-9]+)$") != "")
+               return true;
 
        // Match SD/MMC card whole disk devices names.
        // E.g.: device = mmcblk0 (partition = mmcblk0p1)
-       if (Utils::regexp_label(name, "^(md[0-9]+)$") != "")
+       if (Utils::regexp_label(name, "^(mmcblk[0-9]+)$") != "")
                return true;
 
        // Match NVME (Non-Volatile Memory Express) whole disk device names.


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