summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-24 07:13:30 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-02-24 07:13:30 (GMT)
commitbf1d347964eac6bf25c1595d29fcb761e58c99c3 (patch)
tree8413bb0df7116d741c5265b150508138c5f17b77
parentb702d9aa5ab18e441a7d3cd9f4d65a249b43a351 (diff)
downloadbusybox-bf1d347964eac6bf25c1595d29fcb761e58c99c3.tar.gz
busybox-bf1d347964eac6bf25c1595d29fcb761e58c99c3.tar.bz2
fdisk: do not treat names ending in '0' as partitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/fdisk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index a731316..980568b 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -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);