From: Karel Zak Date: Thu, 4 Sep 2014 12:16:08 +0000 (+0200) Subject: sfdisk: --list just one device X-Git-Tag: v2.26-rc1~405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=207de32a97b14ea57a8bd1ba454e901aa223bd37;p=thirdparty%2Futil-linux.git sfdisk: --list just one device Signed-off-by: Karel Zak --- diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 41ede33065..3cbd10feed 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -148,8 +148,8 @@ static int command_list_partitions(struct sfdisk *sf, int argc, char **argv) fdisk_enable_listonly(sf->cxt, 1); - if (argc > optind) { - for (i = optind; i < argc; i++) + if (argc) { + for (i = 0; i < argc; i++) print_device_pt(sf->cxt, argv[i], 0); } else print_all_devices_pt(sf->cxt);