Commit 39cbd097 authored by Mike Hibler's avatar Mike Hibler

An unused partition is returned by sfdisk as type ' 0' not '0' (space).

This is true in Ubuntu 14 as well as 16, don't know why we didn't see
this sooner.
parent b3393810
......@@ -327,9 +327,9 @@ sub get_parttype($$$)
}
my $ptype = `$SFDISK /dev/$dev -c $pnum 2>/dev/null`;
if ($? == 0 && $ptype) {
if ($? == 0 && defined($ptype)) {
chomp($ptype);
if ($ptype =~ /^([\da-fA-F]+)$/) {
if ($ptype =~ /^\s*([\da-fA-F]+)$/) {
$ptype = hex($1);
} else {
$ptype = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment