sfdisk: --list just one device

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2014-09-04 14:16:08 +02:00
parent 9c1f9dd3a0
commit 207de32a97
1 changed files with 2 additions and 2 deletions

View 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);