From 7f7356af622b3762f8a4b16c28e5daee2a69b220 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 24 Mar 2015 10:04:10 -0400 Subject: further simplify --- perl-install/c/stuff.xs.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 73597cbd7..4b7ce74c3 100755 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -602,7 +602,10 @@ get_disk_partitions(char * device_path) return; part = ped_disk_next_partition(disk, NULL); while(part) { - if(part->num != -1) { + if(part->num == -1) { + part = ped_disk_next_partition(disk, part); + continue; + } char desc[4196]; char *path = ped_partition_get_path(part); sprintf(desc, "%d ", part->num); @@ -626,9 +629,8 @@ get_disk_partitions(char * device_path) } sprintf(desc+strlen(desc), " (%lld,%lld,%lld)", part->geom.start, part->geom.end, part->geom.length); XPUSHs(sv_2mortal(newSVpv(desc, 0))); - } part = ped_disk_next_partition(disk, part); - } + } ped_disk_destroy(disk); } -- cgit v1.2.1