On Tuesday 23 February 2010 21:10, Waldemar Brodkorb wrote:
> On Linux MMC or MicroSD devices are named f.e. mmcblk0 like
> on a FOX Board G20. When using fdisk -l on such targets, the
> partition table is not listed. With this patch you get the requested
> output.
>
> Signed-off-by: Waldemar Brodkorb <[email protected]>
> ---
> util-linux/fdisk.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
> index a731316..101bba5 100644
> --- a/util-linux/fdisk.c
> +++ b/util-linux/fdisk.c
> @@ -2804,7 +2804,9 @@ list_devs_in_proc_partititons(void)
> for (s = ptname; *s; s++)
> continue;
> if (isdigit(s[-1]))
> - continue;
> + if (s[-1] != '0')
> + continue;
> +
> sprintf(devname, "/dev/%s", ptname);
> open_list_and_close(devname, 0);
> }
Committed to git this one:
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;
Thanks!
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox