]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: --list just one device
authorKarel Zak <kzak@redhat.com>
Thu, 4 Sep 2014 12:16:08 +0000 (14:16 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Oct 2014 12:55:30 +0000 (14:55 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 41ede33065c9700bdbe2c684cb04039cfb0e85c2..3cbd10feed7b095d9a9ec8069713ae8c0ff63ba4 100644 (file)
@@ -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);