[Frugalware-git] fwsetup-ng: fix extended partition sizing

James Buren ryuo at frugalware.org
Mon Aug 27 23:01:14 CEST 2012


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=ad3c5b1b80b51a93b079cee37457dea36cfbb39d

commit ad3c5b1b80b51a93b079cee37457dea36cfbb39d
Author: James Buren <ryuo at frugalware.org>
Date:   Mon Aug 27 15:28:50 2012 -0500

fix extended partition sizing

diff --git a/Device.cc b/Device.cc
index ebfb456..c20f580 100644
--- a/Device.cc
+++ b/Device.cc
@@ -237,7 +237,7 @@ void Device::newPartitionTable(const string &label)
{
if(!_initialized || (label != "dos" && label != "gpt"))
return;
-
+
delete _table;

if(label == "dos")
@@ -317,10 +317,10 @@ Partition *Device::newExtendedPartition()
{
Partition *part = 0;

-  if(_table->getLabelType() != "dos")
+  if(!_initialized || _table == 0 || _table->getLabelType() != "dos")
return 0;

-  if((part = newPartition(-1)) == 0)
+  if((part = newPartition(sectorsToSize(getUsableSectors()))) == 0)
return 0;

part->setPurpose("extended");


More information about the Frugalware-git mailing list