fdisk: do not treat names ending in '0' as partitions
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 24 Feb 2010 07:13:30 +0000 (08:13 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 24 Feb 2010 07:13:30 +0000 (08:13 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/fdisk.c

index a731316ce2f6cb172d8930c7d6a6e182ea2942a3..980568bc8c6dab0ecee201636a5f2ccf5d836201 100644 (file)
@@ -2802,8 +2802,9 @@ list_devs_in_proc_partititons(void)
                                &ma, &mi, &sz, ptname) != 4)
                        continue;
                for (s = ptname; *s; s++)
-                       continue;
-               if (isdigit(s[-1]))
+                       continue;
+               /* note: excluding '0': e.g. mmcblk0 is not a partition name! */
+               if (s[-1] >= '1' && s[-1] <= '9')
                        continue;
                sprintf(devname, "/dev/%s", ptname);
                open_list_and_close(devname, 0);