Final 0.6.7 release; minor bug fixes.
diff --git a/CHANGELOG b/CHANGELOG
index fccc838..31ffc26 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,14 @@
-0.6.7 (?/?/2010):
+0.6.7 (5/1/2010):
-----------------
+- Undid earlier change, with version 0.6.4, that wiped the MBR boot loader
+ when doing MBR-to-GPT conversions. I've now become skeptical that MBR
+ boot loaders were causing any real problems on GPT disks, so I'm going
+ back to the philosophy of leaving as much alone as possible.
+
+- Fixed bug that caused incorrect reporting of free space on 0-size disks
+ (e.g., files of 0 length passed as disk images).
+
- Fixed bug that caused segfault on some invalid disks
- Fixed bug that caused incorrect partition numbers to be displayed for
diff --git a/current.spec b/current.spec
index 373769b..8e8592a 100644
--- a/current.spec
+++ b/current.spec
@@ -1,11 +1,11 @@
Summary: An fdisk-like partitioning tool for GPT disks
Name: gdisk
-Version: 0.6.6
+Version: 0.6.7
Release: 1%{?dist}
License: GPLv2
URL: http://www.rodsbooks.com/gdisk
Group: Applications/System
-Source: http://www.rodsbooks.com/gdisk/gdisk-0.6.6.tgz
+Source: http://www.rodsbooks.com/gdisk/gdisk-0.6.7.tgz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
@@ -19,7 +19,7 @@
%setup -q
%build
-CFLAGS="$RPM_OPT_FLAGS" "$RPM_OPT_CXX_FLAGS" make
+CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_CXX_FLAGS" make
%install
rm -rf $RPM_BUILD_ROOT
@@ -40,5 +40,5 @@
%doc %{_mandir}/man8*
%changelog
-* Sun Mar 21 2010 R Smith <rodsmith@rodsbooks.com> - 0.6.6
-- Created spec file for 0.6.6 release
+* Sat May 1 2010 R Smith <rodsmith@rodsbooks.com> - 0.6.7
+- Created spec file for 0.6.7 release
diff --git a/gdisk.8 b/gdisk.8
index ddcec5a..151f923 100644
--- a/gdisk.8
+++ b/gdisk.8
@@ -1,6 +1,6 @@
.\" Copyright 2010 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "GDISK" "8" "0.6.6" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "GDISK" "8" "0.6.7" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
gdisk \- Interactive GUID partition table (GPT) manipulator
.SH "SYNOPSIS"
@@ -155,7 +155,9 @@
string, but \fBgdisk\fR
supports only ASCII characters as names. For the most part, Linux ignores
the partition name, but it may be important in some OSes. GPT fdisk sets
-a default name based on the partition type code.
+a default name based on the partition type code. Note that the GPT partition
+name is different from the filesystem name, which is encoded in the filesystem's
+data structures.
.TP
.B d
diff --git a/gpt.cc b/gpt.cc
index 12aece1..532208f 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -1363,7 +1363,6 @@
// Clear out old data & prepare basics....
ClearGPTData();
- protectiveMBR.EmptyBootloader();
// Convert the smaller of the # of GPT or MBR partitions
if (numParts > MAX_MBR_PARTS)
@@ -2074,19 +2073,21 @@
uint32_t num = 0;
*largestSegment = UINT64_C(0);
- do {
- firstBlock = FindFirstAvailable(start);
- if (firstBlock != UINT64_C(0)) { // something's free...
- lastBlock = FindLastInFree(firstBlock);
- segmentSize = lastBlock - firstBlock + UINT64_C(1);
- if (segmentSize > *largestSegment) {
- *largestSegment = segmentSize;
+ if (diskSize > 0) {
+ do {
+ firstBlock = FindFirstAvailable(start);
+ if (firstBlock != UINT64_C(0)) { // something's free...
+ lastBlock = FindLastInFree(firstBlock);
+ segmentSize = lastBlock - firstBlock + UINT64_C(1);
+ if (segmentSize > *largestSegment) {
+ *largestSegment = segmentSize;
+ } // if
+ totalFound += segmentSize;
+ num++;
+ start = lastBlock + 1;
} // if
- totalFound += segmentSize;
- num++;
- start = lastBlock + 1;
- } // if
- } while (firstBlock != 0);
+ } while (firstBlock != 0);
+ } // if
*numSegments = num;
return totalFound;
} // GPTData::FindFreeBlocks()
diff --git a/gpt.h b/gpt.h
index 751229c..09b51c5 100644
--- a/gpt.h
+++ b/gpt.h
@@ -16,7 +16,7 @@
#ifndef __GPTSTRUCTS
#define __GPTSTRUCTS
-#define GPTFDISK_VERSION "0.6.7-pre1"
+#define GPTFDISK_VERSION "0.6.7"
// Constants used by GPTData::PartsToMBR(). MBR_EMPTY must be the lowest-
// numbered value to refer to partition numbers. (Most will be 0 or positive,
diff --git a/sgdisk.8 b/sgdisk.8
index ea026d2..1685bf8 100644
--- a/sgdisk.8
+++ b/sgdisk.8
@@ -1,6 +1,6 @@
.\" Copyright 2010 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "SGDISK" "8" "0.6.6" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "SGDISK" "8" "0.6.7" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
.SH "SYNOPSIS"
@@ -173,7 +173,9 @@
the partition name, but it may be important in some OSes. GPT fdisk sets
a default name based on the partition type code. If you want to set a name
that includes a space, enclose it in quotation marks, as in
-\fIsgdisk \-c 1:"Sample Name" /dev/sdb\fR.
+\fIsgdisk \-c 1:"Sample Name" /dev/sdb\fR. Note that the GPT name of a
+partition is distinct from the filesystem name, which is encoded in the
+filesystem's data structures.
.TP
.B \-d, \-\-delete=partnum