Hello community,

here is the log from the commit of package gptfdisk for openSUSE:Factory 
checked in at 2013-03-08 10:49:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gptfdisk (Old)
 and      /work/SRC/openSUSE:Factory/.gptfdisk.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gptfdisk", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/gptfdisk/gptfdisk.changes        2012-06-26 
15:46:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gptfdisk.new/gptfdisk.changes   2013-03-08 
10:49:42.000000000 +0100
@@ -1,0 +2,19 @@
+Fri Jan 18 19:58:32 UTC 2013 - [email protected]
+
+- Update to new upstream release 0.8.6
+* add type codes for a Sony System Partition and for VMWare ESX
+* fix the hybrid MBR creation support that could cause it to omit
+  the 0xEE partition under some circumstances
+* fix a bug that could cause a crash when passing a partition
+  number of 0 via the -t option. 
+
+-------------------------------------------------------------------
+Fri Jan 18 12:01:39 UTC 2013 - [email protected]
+
+- remove outdated (0.8.2) debian spec files from package sources
+- fix build for old suse and other distros
+- add gptfdisk-0.8.5-fix-test-suite-short-opt-usage.patch and
+  enable test suite
+- change package group to System/Base (rpmlint fix)
+
+-------------------------------------------------------------------

Old:
----
  debian.changelog
  debian.control
  debian.rules
  gptfdisk-0.8.5.tar.xz
  gptfdisk.dsc

New:
----
  gptfdisk-0.8.5-fix-test-suite-short-opt-usage.patch
  gptfdisk-0.8.6.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gptfdisk.spec ++++++
--- /var/tmp/diff_new_pack.BRb0y8/_old  2013-03-08 10:49:44.000000000 +0100
+++ /var/tmp/diff_new_pack.BRb0y8/_new  2013-03-08 10:49:44.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package gptfdisk
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,30 @@
 
 
 Name:           gptfdisk
-Version:        0.8.5
+Version:        0.8.6
 Release:        0
 Summary:        GPT partitioning and MBR repair software
 License:        GPL-2.0
-Group:          Base/System
+Group:          System/Base
 Url:            http://rodsbooks.com/gdisk
 
-#DL-URL:       http://downloads.sf.net/gptfdisk/gptfdisk-0.8.5.tar.gz
+#DL-URL:       http://downloads.sf.net/gptfdisk/gptfdisk-0.8.6.tar.gz
 Source:         %name-%version.tar.xz
-
+Patch1:         gptfdisk-0.8.5-fix-test-suite-short-opt-usage.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  gcc-c++
 BuildRequires:  ncurses-devel
 BuildRequires:  xz
+%if 0%{?suse_version} > 1140
 BuildRequires:  pkgconfig(icu-io)
 BuildRequires:  pkgconfig(icu-uc)
 BuildRequires:  pkgconfig(popt)
 BuildRequires:  pkgconfig(uuid)
+%else
+BuildRequires:  libicu-devel
+BuildRequires:  libuuid-devel
+BuildRequires:  popt-devel
+%endif
 
 Obsoletes:      gdisk < %version-%release
 Provides:       gdisk = %version-%release
@@ -48,7 +54,7 @@
 
 %package fixparts
 Summary:        A tool for repairing certain types of damage to MBR disks
-Group:          Applications/System
+Group:          System/Base
 
 %description fixparts
 A program that corrects errors that can creep into MBR-partitioned
@@ -58,6 +64,7 @@
 
 %prep
 %setup -q
+%patch -P 1 -p1
 
 %build
 CFLAGS="%optflags" CXXFLAGS="%optflags" make %{?_smp_mflags}
@@ -68,6 +75,9 @@
 install -pm0755 fixparts {,c,s}gdisk "$b/%_sbindir/";
 install -pm0644 *.8 "$b/%_mandir/man8/";
 
+%check
+./gdisk_test.sh
+
 %files
 %defattr(-,root,root)
 %doc NEWS COPYING README

++++++ gptfdisk-0.8.5-fix-test-suite-short-opt-usage.patch ++++++
>From bc168eec1f61cbdb9191fd07da74ae9f5e83495e Mon Sep 17 00:00:00 2001
From: Ruediger Meier <[email protected]>
Date: Fri, 18 Jan 2013 18:37:32 +0100
Subject: [PATCH] fix test suite, short opt usage

Short options and their argument should not separated by "=" but by
space. While this seemed to work with popt 1.16 it does not with
1.13 (which is still used in most recent Fedora distros).

see also popt(3): "A space separates a short  option  from  its
arguments; either a space or an = separates a long option from an
argument."

Signed-off-by: Ruediger Meier <[email protected]>
---
 gdisk_test.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdisk_test.sh b/gdisk_test.sh
index e567d4c..8c5d800 100755
--- a/gdisk_test.sh
+++ b/gdisk_test.sh
@@ -147,7 +147,7 @@ EOF
                ;;
 
                sgdisk)
-                       $SGDISK_BIN $TEMP_DISK -${OPT_NEW}=1 
-${OPT_CHANGE_NAME}=1:"${TEST_PART_DEFAULT_NAME}"
+                       $SGDISK_BIN $TEMP_DISK -${OPT_NEW} 1 
-${OPT_CHANGE_NAME} 1:"${TEST_PART_DEFAULT_NAME}"
                ;;
        esac
 
@@ -171,7 +171,7 @@ EOF
                ;;
 
                sgdisk)
-                       $SGDISK_BIN $TEMP_DISK 
-${OPT_CHANGE_NAME}=1:${TEST_PART_NEWNAME}
+                       $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_NAME} 
1:${TEST_PART_NEWNAME}
                ;;
        esac
 
@@ -195,7 +195,7 @@ EOF
                ;;
 
                sgdisk)
-                       $SGDISK_BIN $TEMP_DISK 
-${OPT_CHANGE_TYPE}=1:${TEST_PART_NEWTYPE}
+                       $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_TYPE} 
1:${TEST_PART_NEWTYPE}
                ;;
        esac
 
@@ -219,7 +219,7 @@ echo ""
                ;;
 
                sgdisk)
-                       $SGDISK_BIN $TEMP_DISK 
-${OPT_BACKUP}=${GPT_BACKUP_FILENAME}
+                       $SGDISK_BIN $TEMP_DISK -${OPT_BACKUP} 
${GPT_BACKUP_FILENAME}
                ;;
        esac
 
@@ -248,7 +248,7 @@ EOF
                ;;
 
                sgdisk)
-                       $SGDISK_BIN $TEMP_DISK -${OPT_DELETE}=1
+                       $SGDISK_BIN $TEMP_DISK -${OPT_DELETE} 1
                ;;
        esac
 
-- 
1.7.6.1

++++++ gptfdisk-0.8.5.tar.xz -> gptfdisk-0.8.6.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/Makefile.mac 
new/gptfdisk-0.8.6/Makefile.mac
--- old/gptfdisk-0.8.5/Makefile.mac     2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/Makefile.mac     2013-01-09 17:09:33.000000000 +0100
@@ -1,8 +1,8 @@
 CC=gcc
 CXX=g++
 CFLAGS=-O2 -D_FILE_OFFSET_BITS=64 -g
-CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/sw/include 
-I/usr/local/include -I/opt/local/include -g
-#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include 
-I/opt/local/include -g
+#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/sw/include 
-I/usr/local/include -I/opt/local/include -g
+CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I/sw/include -I /usr/local/include 
-I/opt/local/include -g
 LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes 
attributes diskio diskio-unix
 MBR_LIBS=support diskio diskio-unix basicmbr mbrpart
 #LIB_SRCS=$(NAMES:=.cc)
@@ -14,16 +14,16 @@
 all:   gdisk sgdisk cgdisk fixparts
 
 gdisk: $(LIB_OBJS) gpttext.o gdisk.o
-#      $(CXX) $(LIB_OBJS) gpttext.o gdisk.o -o gdisk
-       $(CXX) $(LIB_OBJS) -L/usr/lib -licucore gpttext.o gdisk.o -o gdisk
+       $(CXX) $(LIB_OBJS) gpttext.o gdisk.o -o gdisk
+#      $(CXX) $(LIB_OBJS) -L/usr/lib -licucore gpttext.o gdisk.o -o gdisk
 
 cgdisk: $(LIB_OBJS) cgdisk.o gptcurses.o
-#      $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -lncurses -o sgdisk
-       $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -licucore -lncurses 
-o cgdisk
+       $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -lncurses -o cgdisk
+#      $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -licucore -lncurses 
-o cgdisk
 
 sgdisk: $(LIB_OBJS) gptcl.o sgdisk.o
-#      $(CXX) $(LIB_OBJS) gptcl.o sgdisk.o -L/sw/lib -lpopt -o sgdisk
-       $(CXX) $(LIB_OBJS) gptcl.o sgdisk.o -L/sw/lib -licucore -lpopt -o sgdisk
+       $(CXX) $(LIB_OBJS) gptcl.o sgdisk.o -L/sw/lib -lpopt -o sgdisk
+#      $(CXX) $(LIB_OBJS) gptcl.o sgdisk.o -L/sw/lib -licucore -lpopt -o sgdisk
 
 fixparts: $(MBR_LIB_OBJS) fixparts.o
        $(CXX) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) -o fixparts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/NEWS new/gptfdisk-0.8.6/NEWS
--- old/gptfdisk-0.8.5/NEWS     2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/NEWS     2013-01-09 17:09:33.000000000 +0100
@@ -1,3 +1,28 @@
+0.8.6 (1/9/2013):
+-----------------
+
+- Fixed a bug that could cause sgdisk to crash when passing a partition
+  number of 0 to the -t option.
+
+- Added support for building under Solaris.
+
+- Added a new check to the verification code.
+
+- Added partition type code for Sony system partition
+  (F4019732-066E-4E12-8273-346C5641494F). I'm not entirely clear what this
+  is used for, but it's appearing on some new Sony computers.
+
+- Tweaked hybrid MBR creation options to fix a problem that caused the main
+  0xEE MBR partition to NOT be created if the user told gdisk to NOT place
+  it at the start of the disk AND IF fewer than three partitions are
+  hybridize AND IF the user opted to create a second protective partition.
+
+- Changed default build options for Mac OS X to *NOT* use libicu,
+  since it seems to have broken somewhere along the line. It still
+  works on Linux, though.
+
+- Added partition type codes for VMWare ESX (FB00, FB01, and FC00).
+
 0.8.5 (5/30/2012):
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/README new/gptfdisk-0.8.6/README
--- old/gptfdisk-0.8.5/README   2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/README   2013-01-09 17:09:33.000000000 +0100
@@ -78,7 +78,7 @@
   access up to three GPT partitions on the disk (gdisk and sgdisk only)
 
 Of course, GPT fdisk isn't without its limitations. Most notably, it lacks
-the filesystem awareness and filesystem-related features of GNU Parted. You
+the filesystem awareness and filesystem-related features of GParted. You
 can't resize a partition's filesystem or create a partition with a
 filesystem already in place with gdisk, for instance. There's no GUI
 version of gdisk.
@@ -166,10 +166,10 @@
 compiler for C++. (Under Windows, Microsoft Visual C++ 2008 can also be
 used.) In addition, note these requirements:
 
-* On Linux, FreeBSD, and OS X, libuuid must be installed. This is the
-  standard for Linux and OS X, although you may need to install a package
-  called uuid-dev or something similar to get the headers. On FreeBSD, the
-  e2fsprogs-libuuid port must be installed.
+* On Linux, FreeBSD, OS X, and Solaris, libuuid must be installed. This is
+  the standard for Linux and OS X, although you may need to install a
+  package called uuid-dev or something similar to get the headers. On
+  FreeBSD, the e2fsprogs-libuuid port must be installed.
 
 * The ICU library (http://site.icu-project.org), which provides support for
   Unicode partition names, is recommended on all
@@ -180,7 +180,9 @@
   "-D USE_UTF16" part from the CXXFLAGS line and remove references to
   -licuio, -licuuc, -licudata, and -licucore (details vary between
   platforms) from the compilation options. Suitable lines are present, but
-  commented out, in the Makefile, Makefile.mac, and Makefile.bsd files.
+  commented out, in the Makefile, Makefile.solaris, Makefile.freebsd files.
+  Because of problems with ICU under OS X, the Makefile.mac file doesn't
+  build against ICU by default.
 
 * The cgdisk program requires the ncurses library and its development files
   (headers). Most Linux distributions install ncurses by default, but you
@@ -205,16 +207,16 @@
 When all the necessary development tools and libraries are installed, you
 can uncompress the package and type "make" at the command prompt in the
 resulting directory. (You may need to type "make -f Makefile.mac" on Mac OS
-X, "make -f Makefile.freebsd" on FreeBSD, or "make -f Makefile.mingw" to
-compile using MinGW for Windows.) You may also need to add header (include)
-directories or library directories by setting the CXXFLAGS environment
-variable or by editing the Makefile. The result should be program files
-called gdisk, sgdisk, and fixparts. Typing "make gdisk", "make cgdisk",
-"make sgdisk", or "make fixparts" will compile only the requested programs.
-You can use these programs in place or copy the files to a suitable
-directory, such as /usr/local/sbin. You can copy the man pages (gdisk.8,
-cgdisk.8, sgdisk.8, and fixparts.8) to /usr/local/man/man8 to make them
-available.
+X, "make -f Makefile.freebsd" on FreeBSD, "make -f Makefile.solaris" on
+Solaris, or "make -f Makefile.mingw" to compile using MinGW for Windows.)
+You may also need to add header (include) directories or library
+directories by setting the CXXFLAGS environment variable or by editing the
+Makefile. The result should be program files called gdisk, cgdisk, sgdisk,
+and fixparts. Typing "make gdisk", "make cgdisk", "make sgdisk", or "make
+fixparts" will compile only the requested programs. You can use these
+programs in place or copy the files to a suitable directory, such as
+/usr/local/sbin. You can copy the man pages (gdisk.8, cgdisk.8, sgdisk.8,
+and fixparts.8) to /usr/local/man/man8 to make them available.
 
 Caveats
 -------
@@ -230,9 +232,9 @@
 RAID arrays over 2TiB in size, though.
 
 My main development platform is a system running the 64-bit version of
-Gentoo Linux (previously Ubuntu 8.04). I've also tested on several other
-32- and 64-bit Linux distributions, Intel-based Mac OS X 10.5 and 10.6,
-64-bit FreeBSD 7.1, and Windows 7.
+Gentoo Linux. I've also tested on several other 32- and 64-bit Linux
+distributions, Intel-based Mac OS X 10.5 and 10.6, 64-bit FreeBSD 7.1, and
+Windows 7.
 
 Redistribution
 --------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/cgdisk.8 new/gptfdisk-0.8.6/cgdisk.8
--- old/gptfdisk-0.8.5/cgdisk.8 2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/cgdisk.8 2013-01-09 17:09:33.000000000 +0100
@@ -1,6 +1,6 @@
-.\" Copyright 2011, 2012 Roderick W. Smith ([email protected])
+.\" Copyright 2011-2013 Roderick W. Smith ([email protected])
 .\" May be distributed under the GNU General Public License
-.TH "CGDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "CGDISK" "8" "0.8.6" "Roderick W. Smith" "GPT fdisk Manual"
 .SH "NAME"
 cgdisk \- Curses-based GUID partition table (GPT) manipulator
 .SH "SYNOPSIS"
@@ -268,7 +268,7 @@
 
 .SH "BUGS"
 
-As of May 2012 (version 0.8.5), \fBcgdisk\fR should be considered
+As of January 2013 (version 0.8.6), \fBcgdisk\fR should be considered
 beta software. Although the underlying partition manipulation code is much
 older, the \fBcgdisk\fR ncurses user interface is brand new with GPT fdisk
 version 0.8.0. Known bugs and limitations include:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/cgdisk.html 
new/gptfdisk-0.8.6/cgdisk.html
--- old/gptfdisk-0.8.5/cgdisk.html      2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/cgdisk.html      2013-01-09 17:09:33.000000000 +0100
@@ -3,7 +3,7 @@
 <HTML><HEAD><TITLE>Manpage of CGDISK</TITLE>
 </HEAD><BODY>
 <H1>CGDISK</H1>
-Section: GPT fdisk Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
+Section: GPT fdisk Manual (8)<BR>Updated: 0.8.6<BR><A HREF="#index">Index</A>
 <A HREF="http://localhost/cgi-bin/man/man2html";>Return to Main Contents</A><HR>
 
 <A NAME="lbAB">&nbsp;</A>
@@ -322,7 +322,7 @@
 <H2>BUGS</H2>
 
 <P>
-As of May 2012 (version 0.8.5), <B>cgdisk</B> should be considered
+As of January 2013 (version 0.8.6), <B>cgdisk</B> should be considered
 beta software. Although the underlying partition manipulation code is much
 older, the <B>cgdisk</B> ncurses user interface is brand new with GPT fdisk
 version 0.8.0. Known bugs and limitations include:
@@ -472,6 +472,6 @@
 This document was created by
 <A HREF="http://localhost/cgi-bin/man/man2html";>man2html</A>,
 using the manual pages.<BR>
-Time: 15:38:43 GMT, May 30, 2012
+Time: 16:09:33 GMT, January 09, 2013
 </BODY>
 </HTML>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/current.spec 
new/gptfdisk-0.8.6/current.spec
--- old/gptfdisk-0.8.5/current.spec     2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/current.spec     2013-01-09 17:09:33.000000000 +0100
@@ -1,11 +1,11 @@
 Summary: GPT partitioning and MBR repair software
 Name: gptfdisk
-Version: 0.8.5
+Version: 0.8.6
 Release: 1%{?dist}
 License: GPLv2
 URL: http://www.rodsbooks.com/gdisk
 Group: Applications/System
-Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.5.tar.gz
+Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.6.tar.gz
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 %description
@@ -80,5 +80,5 @@
 
 
 %changelog
-* Wed May 30 2012 R Smith <[email protected]> - 0.8.5
-- Created spec file for 0.8.5 release
+* Wed Jan 9 2013 R Smith <[email protected]> - 0.8.6
+- Created spec file for 0.8.6 release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/diskio-unix.cc 
new/gptfdisk-0.8.6/diskio-unix.cc
--- old/gptfdisk-0.8.5/diskio-unix.cc   2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/diskio-unix.cc   2013-01-09 17:09:33.000000000 +0100
@@ -132,6 +132,9 @@
 // (512). If the disk can't be opened at all, return a value of 0.
 int DiskIO::GetBlockSize(void) {
    int err = -1, blockSize = 0;
+#ifdef __sun__
+   struct dk_minfo minfo;
+#endif
 
    // If disk isn't open, try to open it....
    if (!isOpen) {
@@ -142,6 +145,11 @@
 #ifdef __APPLE__
       err = ioctl(fd, DKIOCGETBLOCKSIZE, &blockSize);
 #endif
+#ifdef __sun__
+      err = ioctl(fd, DKIOCGMEDIAINFO, &minfo);
+      if (err == 0)
+          blockSize = minfo.dki_lbsize;
+#endif
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
       err = ioctl(fd, DIOCGSECTORSIZE, &blockSize);
 #endif
@@ -217,13 +225,17 @@
 
    if (isOpen) {
       sync();
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__sun__)
       cout << "Warning: The kernel may continue to use old or deleted 
partitions.\n"
            << "You should reboot or remove the drive.\n";
                /* don't know if this helps
                * it definitely will get things on disk though:
                * http://topiks.org/mac-os-x/0321278542/ch12lev1sec8.html */
+#ifdef __sun__
+      i = ioctl(fd, DKIOCFLUSHWRITECACHE);
+#else
       i = ioctl(fd, DKIOCSYNCHRONIZECACHE);
+#endif
       platformFound++;
 #endif
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
@@ -377,6 +389,9 @@
    off_t bytes = 0; // size in bytes
    struct stat64 st;
    int platformFound = 0;
+#ifdef __sun__
+   struct dk_minfo minfo;
+#endif
 
    // If disk isn't open, try to open it....
    if (!isOpen) {
@@ -393,6 +408,12 @@
       *err = ioctl(fd, DKIOCGETBLOCKCOUNT, &sectors);
       platformFound++;
 #endif
+#ifdef __sun__
+      *err = ioctl(fd, DKIOCGMEDIAINFO, &minfo);
+      if (*err == 0)
+          sectors = minfo.dki_capacity;
+      platformFound++;
+#endif
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
       *err = ioctl(fd, DIOCGMEDIASIZE, &bytes);
       long long b = GetBlockSize();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/diskio.h new/gptfdisk-0.8.6/diskio.h
--- old/gptfdisk-0.8.5/diskio.h 2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/diskio.h 2013-01-09 17:09:33.000000000 +0100
@@ -25,6 +25,10 @@
 #include <sys/ioctl.h>
 #endif
 
+#ifdef __sun__
+#include <sys/dkio.h>
+#endif
+
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined 
(__APPLE__)
 #define fstat64 fstat
 #define stat64 stat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/fixparts.8 
new/gptfdisk-0.8.6/fixparts.8
--- old/gptfdisk-0.8.5/fixparts.8       2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/fixparts.8       2013-01-09 17:09:33.000000000 +0100
@@ -1,6 +1,6 @@
-.\" Copyright 2011, 2012 Roderick W. Smith ([email protected])
+.\" Copyright 2011-2013 Roderick W. Smith ([email protected])
 .\" May be distributed under the GNU General Public License
-.TH "FIXPARTS" "8" "0.8.5" "Roderick W. Smith" "FixParts Manual"
+.TH "FIXPARTS" "8" "0.8.6" "Roderick W. Smith" "FixParts Manual"
 .SH "NAME"
 fixparts \- MBR partition table repair utility
 .SH "SYNOPSIS"
@@ -39,13 +39,13 @@
 Additional features include the ability to change partition type codes or
 boot/active flags, to delete partitions, and to recompute CHS values. With
 the possible exception of recomputing CHS values, these secondary features
-are better performed with \fBfdisk\fR, because \fBfixpart\fR's design means
+are better performed with \fBfdisk\fR, because \fBfixparts\fR' design means
 that it's likely to alter partition numbering even when such changes are
 not requested.
 
-The \fBfixpart\fR program employs a user interface similar to that of
-Linux's \fBfdisk\fR, but \fBfixpart\fR is much more specialized. Most
-importantly, you can't create new partitions with \fBfixpart\fR, although
+The \fBfixparts\fR program employs a user interface similar to that of
+Linux's \fBfdisk\fR, but \fBfixparts\fR is much more specialized. Most
+importantly, you can't create new partitions with \fBfixparts\fR, although
 you can change primary/logical assignment.
 
 In the MBR scheme, partitions come in three varieties:
@@ -64,10 +64,10 @@
 .TP
 .B logical
 A disk can contain an arbitrary number of logical partitions
-(\fBfixpart\fR, however, imposes a limit of 124 logical partitions). All
+(\fBfixparts\fR, however, imposes a limit of 124 logical partitions). All
 the logical partitions reside inside a single extended partition, and are
 defined using a linked-list data structure. This fact means that every
-logical partition be preceded by at least one sector of unallocated space
+logical partition must be preceded by at least one sector of unallocated space
 to hold its defining data structure (an Extended Boot Record, or EBR).
 
 .PP
@@ -81,7 +81,7 @@
 partition within an extended partition (which is just a specific type of
 primary partition).
 
-Unlike most disk utilities, \fBfixpart\fR's user interface ignores extended
+Unlike most disk utilities, \fBfixparts\fR' user interface ignores extended
 partitions. Internally, the program discards the information on the
 original extended partition and, when you tell it to save its changes, it
 generates a new extended partition to contain the then-defined logical
@@ -89,19 +89,19 @@
 tool performs require generating a fresh extended partition, so keeping the
 original in the user interface would only be a complication.
 
-Another unusual feature of \fBfixpart\fR's user interface is that partition
+Another unusual feature of \fBfixparts\fR' user interface is that partition
 numbers do not necessarily correlate with primary/logical status. In most
 utilities, partitions 1\-4 correspond to primary partitions, whereas
-partitions 5 and up are logical partitions. In \fBfixpart\fR, any partition
+partitions 5 and up are logical partitions. In \fBfixparts\fR, any partition
 number may be assigned primary or logical status, so long as the rules for
 layout described earlier are obeyed. When the partition table is saved,
 partitions will be assigned appropriately and then tools such as the Linux
 kernel and \fBfdisk\fR will give them conventional numbers.
 
-When it first starts, \fBfixpart\fR performs a scan for GPT data. If the
-disk looks like a conventional GPT disk, \fBfixpart\fR refuses to run. If
+When it first starts, \fBfixparts\fR performs a scan for GPT data. If the
+disk looks like a conventional GPT disk, \fBfixparts\fR refuses to run. If
 the disk appears to be a conventional MBR disk but GPT signatures are
-present in the GPT primary or secondary header areas, \fBfixpart\fR
+present in the GPT primary or secondary header areas, \fBfixparts\fR
 offers to delete this extraneous data. If you tell it to do so, the program
 immediately wipes the GPT header or headers. (If only one header was found,
 only that one header will be erased, to minimize the risk of damaging a
@@ -109,7 +109,7 @@
 headers.)
 
 With the exception of optionally erasing leftover GPT data when it first
-starts, \fBfixpart\fR keeps all changes in memory until the user writes
+starts, \fBfixparts\fR keeps all changes in memory until the user writes
 changes with the \fBw\fR command. Thus, you can adjust your partitions in
 the user interface and abort those changes by typing \fBq\fR to quit
 without saving changes.
@@ -147,7 +147,7 @@
 .TP 
 .B o
 Omit a partition. Once omitted, the partition will still appear in the
-\fBfixpart\fR partition list, but it will be flagged as omitted. You can
+\fBfixparts\fR partition list, but it will be flagged as omitted. You can
 subsequently convert it to primary or logical form with the \fBr\fR or
 \fBl\fR commands, respectively. When you save your changes with \fBw\fR,
 though, the partition will be lost.
@@ -202,7 +202,7 @@
 .PP 
 
 .SH "BUGS"
-As of May 2012 (version 0.8.5), \fBfixparts\fR
+As of January 2013 (version 0.8.6), \fBfixparts\fR
 should be considered beta software. Known bugs and limitations include:
 
 .TP 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/fixparts.html 
new/gptfdisk-0.8.6/fixparts.html
--- old/gptfdisk-0.8.5/fixparts.html    2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/fixparts.html    2013-01-09 17:09:33.000000000 +0100
@@ -3,7 +3,7 @@
 <HTML><HEAD><TITLE>Manpage of FIXPARTS</TITLE>
 </HEAD><BODY>
 <H1>FIXPARTS</H1>
-Section: FixParts Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
+Section: FixParts Manual (8)<BR>Updated: 0.8.6<BR><A HREF="#index">Index</A>
 <A HREF="http://localhost/cgi-bin/man/man2html";>Return to Main Contents</A><HR>
 
 <A NAME="lbAB">&nbsp;</A>
@@ -58,13 +58,13 @@
 Additional features include the ability to change partition type codes or
 boot/active flags, to delete partitions, and to recompute CHS values. With
 the possible exception of recomputing CHS values, these secondary features
-are better performed with <B>fdisk</B>, because <B>fixpart</B>'s design means
+are better performed with <B>fdisk</B>, because <B>fixparts</B>' design means
 that it's likely to alter partition numbering even when such changes are
 not requested.
 <P>
-The <B>fixpart</B> program employs a user interface similar to that of
-Linux's <B>fdisk</B>, but <B>fixpart</B> is much more specialized. Most
-importantly, you can't create new partitions with <B>fixpart</B>, although
+The <B>fixparts</B> program employs a user interface similar to that of
+Linux's <B>fdisk</B>, but <B>fixparts</B> is much more specialized. Most
+importantly, you can't create new partitions with <B>fixparts</B>, although
 you can change primary/logical assignment.
 <P>
 In the MBR scheme, partitions come in three varieties:
@@ -87,10 +87,10 @@
 
 <DD>
 A disk can contain an arbitrary number of logical partitions
-(<B>fixpart</B>, however, imposes a limit of 124 logical partitions). All
+(<B>fixparts</B>, however, imposes a limit of 124 logical partitions). All
 the logical partitions reside inside a single extended partition, and are
 defined using a linked-list data structure. This fact means that every
-logical partition be preceded by at least one sector of unallocated space
+logical partition must be preceded by at least one sector of unallocated space
 to hold its defining data structure (an Extended Boot Record, or EBR).
 <P>
 </DL>
@@ -106,7 +106,7 @@
 partition within an extended partition (which is just a specific type of
 primary partition).
 <P>
-Unlike most disk utilities, <B>fixpart</B>'s user interface ignores extended
+Unlike most disk utilities, <B>fixparts</B>' user interface ignores extended
 partitions. Internally, the program discards the information on the
 original extended partition and, when you tell it to save its changes, it
 generates a new extended partition to contain the then-defined logical
@@ -114,19 +114,19 @@
 tool performs require generating a fresh extended partition, so keeping the
 original in the user interface would only be a complication.
 <P>
-Another unusual feature of <B>fixpart</B>'s user interface is that partition
+Another unusual feature of <B>fixparts</B>' user interface is that partition
 numbers do not necessarily correlate with primary/logical status. In most
 utilities, partitions 1-4 correspond to primary partitions, whereas
-partitions 5 and up are logical partitions. In <B>fixpart</B>, any partition
+partitions 5 and up are logical partitions. In <B>fixparts</B>, any partition
 number may be assigned primary or logical status, so long as the rules for
 layout described earlier are obeyed. When the partition table is saved,
 partitions will be assigned appropriately and then tools such as the Linux
 kernel and <B>fdisk</B> will give them conventional numbers.
 <P>
-When it first starts, <B>fixpart</B> performs a scan for GPT data. If the
-disk looks like a conventional GPT disk, <B>fixpart</B> refuses to run. If
+When it first starts, <B>fixparts</B> performs a scan for GPT data. If the
+disk looks like a conventional GPT disk, <B>fixparts</B> refuses to run. If
 the disk appears to be a conventional MBR disk but GPT signatures are
-present in the GPT primary or secondary header areas, <B>fixpart</B>
+present in the GPT primary or secondary header areas, <B>fixparts</B>
 offers to delete this extraneous data. If you tell it to do so, the program
 immediately wipes the GPT header or headers. (If only one header was found,
 only that one header will be erased, to minimize the risk of damaging a
@@ -134,7 +134,7 @@
 headers.)
 <P>
 With the exception of optionally erasing leftover GPT data when it first
-starts, <B>fixpart</B> keeps all changes in memory until the user writes
+starts, <B>fixparts</B> keeps all changes in memory until the user writes
 changes with the <B>w</B> command. Thus, you can adjust your partitions in
 the user interface and abort those changes by typing <B>q</B> to quit
 without saving changes.
@@ -179,7 +179,7 @@
 
 <DD>
 Omit a partition. Once omitted, the partition will still appear in the
-<B>fixpart</B> partition list, but it will be flagged as omitted. You can
+<B>fixparts</B> partition list, but it will be flagged as omitted. You can
 subsequently convert it to primary or logical form with the <B>r</B> or
 <B>l</B> commands, respectively. When you save your changes with <B>w</B>,
 though, the partition will be lost.
@@ -245,7 +245,7 @@
 <A NAME="lbAF">&nbsp;</A>
 <H2>BUGS</H2>
 
-As of May 2012 (version 0.8.5), <B>fixparts</B>
+As of January 2013 (version 0.8.6), <B>fixparts</B>
 should be considered beta software. Known bugs and limitations include:
 <P>
 <DL COMPACT>
@@ -357,6 +357,6 @@
 This document was created by
 <A HREF="http://localhost/cgi-bin/man/man2html";>man2html</A>,
 using the manual pages.<BR>
-Time: 15:38:43 GMT, May 30, 2012
+Time: 16:09:33 GMT, January 09, 2013
 </BODY>
 </HTML>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gdisk.8 new/gptfdisk-0.8.6/gdisk.8
--- old/gptfdisk-0.8.5/gdisk.8  2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/gdisk.8  2013-01-09 17:09:33.000000000 +0100
@@ -1,6 +1,6 @@
-.\" Copyright 2011, 2012 Roderick W. Smith ([email protected])
+.\" Copyright 2011-2013 Roderick W. Smith ([email protected])
 .\" May be distributed under the GNU General Public License
-.TH "GDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "GDISK" "8" "0.8.6" "Roderick W. Smith" "GPT fdisk Manual"
 .SH "NAME"
 gdisk \- Interactive GUID partition table (GPT) manipulator
 .SH "SYNOPSIS"
@@ -561,7 +561,7 @@
 usually bypasses the prompt entirely.
 
 .SH "BUGS"
-As of May 2012 (version 0.8.5), \fBgdisk\fR
+As of January 2013 (version 0.8.6), \fBgdisk\fR
 should be considered beta software. Known bugs and limitations include:
 
 .TP 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gdisk.html 
new/gptfdisk-0.8.6/gdisk.html
--- old/gptfdisk-0.8.5/gdisk.html       2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/gdisk.html       2013-01-09 17:09:33.000000000 +0100
@@ -3,7 +3,7 @@
 <HTML><HEAD><TITLE>Manpage of GDISK</TITLE>
 </HEAD><BODY>
 <H1>GDISK</H1>
-Section: GPT fdisk Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
+Section: GPT fdisk Manual (8)<BR>Updated: 0.8.6<BR><A HREF="#index">Index</A>
 <A HREF="http://localhost/cgi-bin/man/man2html";>Return to Main Contents</A><HR>
 
 <A NAME="lbAB">&nbsp;</A>
@@ -656,7 +656,7 @@
 <A NAME="lbAF">&nbsp;</A>
 <H2>BUGS</H2>
 
-As of May 2012 (version 0.8.5), <B>gdisk</B>
+As of January 2013 (version 0.8.6), <B>gdisk</B>
 should be considered beta software. Known bugs and limitations include:
 <P>
 <DL COMPACT>
@@ -816,6 +816,6 @@
 This document was created by
 <A HREF="http://localhost/cgi-bin/man/man2html";>man2html</A>,
 using the manual pages.<BR>
-Time: 15:38:43 GMT, May 30, 2012
+Time: 16:09:33 GMT, January 09, 2013
 </BODY>
 </HTML>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gpt.cc new/gptfdisk-0.8.6/gpt.cc
--- old/gptfdisk-0.8.5/gpt.cc   2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gpt.cc   2013-01-09 17:09:33.000000000 +0100
@@ -3,7 +3,7 @@
 
 /* By Rod Smith, initial coding January to February, 2009 */
 
-/* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is 
distributed
+/* This program is copyright (c) 2009-2012 by Roderick W. Smith. It is 
distributed
   under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
 
 #define __STDC_LIMIT_MACROS
@@ -259,6 +259,14 @@
            << "The 'e' option on the experts' menu may fix this problem.\n";
    } // if
 
+   if ((mainHeader.lastUsableLBA >= diskSize) || (mainHeader.lastUsableLBA > 
mainHeader.backupLBA)) {
+      problems++;
+      cout << "\nProblem: GPT claims the disk is larger than it is! (Claimed 
last usable\n"
+           << "sector is " << mainHeader.lastUsableLBA << ", but backup header 
is at\n"
+           << mainHeader.backupLBA << " and disk size is " << diskSize << " 
sectors.\n"
+           << "The 'e' option on the experts' menu will probably fix this 
problem\n";
+   }
+
    // Check for overlapping partitions....
    problems += FindOverlaps();
 
@@ -1018,6 +1026,21 @@
       } // if/else quiet
    } // if
 
+   if ((mainHeader.lastUsableLBA >= diskSize) || (mainHeader.lastUsableLBA > 
mainHeader.backupLBA)) {
+      if (quiet == 0) {
+         cout << "Warning! The claimed last usable sector is incorrect! Do you 
want to correct\n"
+              << "this problem? ";
+         if (GetYN() == 'Y') {
+            MoveSecondHeaderToEnd();
+            cout << "Have adjusted the second header and last usable sector 
value.\n";
+         } else {
+            cout << "Have not corrected the problem. Strange problems may 
occur in the future!\n";
+         } // if correction requested
+      } else { // go ahead and do correction automatically
+         MoveSecondHeaderToEnd();
+      } // if/else quiet
+   } // if
+
    // Check for overlapping or insane partitions....
    if ((FindOverlaps() > 0) || (FindInsanePartitions() > 0)) {
       allOK = 0;
@@ -1718,7 +1741,7 @@
          if (FindLastInFree(startSector) >= endSector) {
             partitions[partNum].SetFirstLBA(startSector);
             partitions[partNum].SetLastLBA(endSector);
-            partitions[partNum].SetType(DEFAULT_TYPE);
+            partitions[partNum].SetType(DEFAULT_GPT_TYPE);
             partitions[partNum].RandomizeUniqueGUID();
          } else retval = 0; // if free space until endSector
       } else retval = 0; // if startSector is free
@@ -2196,12 +2219,12 @@
 // sector size), but not by the previously-located alignment value, then the
 // alignment value is adjusted down. If the computed alignment is less than 8
 // and the disk is bigger than SMALLEST_ADVANCED_FORMAT, resets it to 8. This
-// is a safety measure for WD Advanced Format and similar drives. If no 
partitions
-// are defined, the alignment value is set to DEFAULT_ALIGNMENT (2048) (or an
+// is a safety measure for Advanced Format drives. If no partitions are
+// defined, the alignment value is set to DEFAULT_ALIGNMENT (2048) (or an
 // adjustment of that based on the current sector size). The result is that new
 // drives are aligned to 2048-sector multiples but the program won't complain
 // about other alignments on existing disks unless a smaller-than-8 alignment
-// is used on big disks (as safety for WD Advanced Format drives).
+// is used on big disks (as safety for Advanced Format drives).
 // Returns the computed alignment value.
 uint32_t GPTData::ComputeAlignment(void) {
    uint32_t i = 0, found, exponent = 31;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gpt.h new/gptfdisk-0.8.6/gpt.h
--- old/gptfdisk-0.8.5/gpt.h    2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gpt.h    2013-01-09 17:09:33.000000000 +0100
@@ -183,7 +183,7 @@
    int IsFree(uint64_t sector, uint32_t *partNum = NULL);
    int IsFreePartNum(uint32_t partNum);
    int IsUsedPartNum(uint32_t partNum);
-   
+
    // Change how functions work, or return information on same
    void SetAlignment(uint32_t n);
    uint32_t ComputeAlignment(void); // Set alignment based on current 
partitions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gptcl.cc new/gptfdisk-0.8.6/gptcl.cc
--- old/gptfdisk-0.8.5/gptcl.cc 2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gptcl.cc 2013-01-09 17:09:33.000000000 +0100
@@ -49,7 +49,7 @@
       neverSaveData = 1;
       cerr << "Error loading backup file!\n";
    } // else
-} // 
+} // GPTDataCL::LoadBackupFile()
 
 // Perform the actions specified on the command line. This is necessarily one
 // monster of a function!
@@ -64,7 +64,6 @@
    GPTData secondDevice;
    int opt, numOptions = 0, saveData = 0, neverSaveData = 0;
    int partNum = 0, saveNonGPT = 1, retval = 0, pretend = 0;
-   uint32_t gptPartNum = 0;
    uint64_t low, high, startSector, endSector, sSize;
    uint64_t temp; // temporary variable; free to use in any case
    char *device;
@@ -113,14 +112,14 @@
 
    // Create popt context...
    poptCon = poptGetContext(NULL, argc, (const char**) argv, theOptions, 0);
-   
+
    poptSetOtherOptionHelp(poptCon, " [OPTION...] <device>");
-   
+
    if (argc < 2) {
       poptPrintUsage(poptCon, stderr, 0);
       return 1;
    }
-   
+
    // Do one loop through the options to find the device filename and deal
    // with options that don't require a device filename, to flag destructive
    // (o, z, or Z) options, and to flag presence of an
@@ -145,11 +144,11 @@
       } // switch
       numOptions++;
    } // while
-   
+
    // Assume first non-option argument is the device filename....
    device = (char*) poptGetArg(poptCon);
    poptResetContext(poptCon);
-   
+
    if (device != NULL) {
       JustLooking(); // reset as necessary
       BeQuiet(); // Tell called functions to be less verbose & interactive
@@ -194,15 +193,17 @@
                case 'c':
                   JustLooking(0);
                   partNum = (int) GetInt(partName, 1) - 1;
-                  name = GetString(partName, 2);
-                  if (SetName(partNum, (UnicodeString) name.c_str())) {
-                     saveData = 1;
-                  } else {
-                     cerr << "Unable to set partition " << partNum + 1
-                     << "'s name to '" << GetString(partName, 2) << "'!\n";
-                     neverSaveData = 1;
-                  } // if/else
-                  free(partName);
+                  if ((partNum >= 0) && (partNum < (int) GetNumParts())) {
+                     name = GetString(partName, 2);
+                     if (SetName(partNum, (UnicodeString) name.c_str())) {
+                        saveData = 1;
+                     } else {
+                        cerr << "Unable to set partition " << partNum + 1
+                             << "'s name to '" << GetString(partName, 2) << 
"'!\n";
+                        neverSaveData = 1;
+                     } // if/else
+                     free(partName);
+                  }
                   break;
                case 'C':
                   JustLooking(0);
@@ -348,16 +349,18 @@
                case 't':
                   JustLooking(0);
                   partNum = (int) GetInt(typeCode, 1) - 1;
-                  typeHelper = GetString(typeCode, 2);
-                  if ((typeHelper != (GUIDData) 
"00000000-0000-0000-0000-000000000000") &&
-                     (ChangePartType(partNum, typeHelper))) {
-                     saveData = 1;
-                     } else {
-                        cerr << "Could not change partition " << partNum + 1
-                        << "'s type code to " << GetString(typeCode, 2) << 
"!\n";
-                        neverSaveData = 1;
-                     } // if/else
+                  if ((partNum >= 0) && (partNum < (int) GetNumParts())) {
+                     typeHelper = GetString(typeCode, 2);
+                     if ((typeHelper != (GUIDData) 
"00000000-0000-0000-0000-000000000000") &&
+                         (ChangePartType(partNum, typeHelper))) {
+                        saveData = 1;
+                        } else {
+                           cerr << "Could not change partition " << partNum + 1
+                           << "'s type code to " << GetString(typeCode, 2) << 
"!\n";
+                           neverSaveData = 1;
+                        } // if/else
                      free(typeCode);
+                  }
                   break;
                case 'T':
                   JustLooking(0);
@@ -367,8 +370,10 @@
                case 'u':
                   JustLooking(0);
                   saveData = 1;
-                  gptPartNum = (int) GetInt(partGUID, 1) - 1;
-                  SetPartitionGUID(gptPartNum, GetString(partGUID, 2).c_str());
+                  partNum = (int) GetInt(partGUID, 1) - 1;
+                  if ((partNum >= 0) && (partNum < (int) GetNumParts())) {
+                     SetPartitionGUID(partNum, GetString(partGUID, 2).c_str());
+                  }
                   break;
                case 'U':
                   JustLooking(0);
@@ -499,17 +504,17 @@
 // does).
 int CountColons(char* argument) {
    int num = 0;
-   
+
    while ((argument[0] != '\0') && (argument = strchr(&argument[1], ':')))
       num++;
-   
+
    return num;
 } // GPTDataCL::CountColons()
 
 // Extract integer data from argument string, which should be colon-delimited
 uint64_t GetInt(const string & argument, int itemNum) {
    uint64_t retval;
-   
+
    istringstream inString(GetString(argument, itemNum));
    inString >> retval;
    return retval;
@@ -523,7 +528,7 @@
    string retVal = "";
    int foundLast = 0;
    int numFound = 0;
-   
+
    if (argument[0] == ':')
       argument.erase(0, 1);
    while ((numFound < itemNum) && (!foundLast)) {
@@ -538,6 +543,6 @@
    } // while
    if ((numFound == itemNum) && (numFound > 0))
       retVal = argument.substr(startPos, endPos - startPos);
-   
+
    return retVal;
 } // GetString()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gptcurses.cc 
new/gptfdisk-0.8.6/gptcurses.cc
--- old/gptfdisk-0.8.5/gptcurses.cc     2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gptcurses.cc     2013-01-09 17:09:33.000000000 +0100
@@ -219,7 +219,9 @@
 Space* GPTDataCurses::ShowSpace(int spaceNum, int lineNum) {
    Space *space;
    int i = 0;
+#ifdef USE_UTF16
    char temp[40];
+#endif
 
    space = firstSpace;
    while ((space != NULL) && (i < spaceNum)) {
@@ -308,7 +310,9 @@
 // Displays information on the specified partition
 void GPTDataCurses::ShowInfo(int partNum) {
    uint64_t size;
+#ifdef USE_UTF16
    char temp[NAME_SIZE / 2 + 1];
+#endif
 
    clear();
    move(2, (COLS - 29) / 2);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gptpart.cc 
new/gptfdisk-0.8.6/gptpart.cc
--- old/gptfdisk-0.8.5/gptpart.cc       2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gptpart.cc       2013-01-09 17:09:33.000000000 +0100
@@ -114,6 +114,7 @@
 // Set the name for a partition to theName, using a Unicode string as
 // input.
 void GPTPart::SetName(const UnicodeString & theName) {
+   cout << "Entering GPTPart::SetName(const UnicodeString...)\n";
    if (theName.isBogus()) {
       cerr << "Bogus UTF-16 name found in GPTPart::SetName()! Name not 
changed!\n";
    } else {
@@ -138,7 +139,7 @@
    memset(name, 0, NAME_SIZE);
    for (i = 0; i < length; i++)
       name[i * 2] = theName[i];
-} // GPTPart::SetName(), Windows version
+} // GPTPart::SetName(), ASCII version
 #endif
 
 // Set the name for the partition based on the current GUID partition type
@@ -276,13 +277,13 @@
 
    cout << "Current type is '" << GetTypeName() << "'\n";
    do {
-      cout << "Hex code or GUID (L to show codes, Enter = " << hex << 
DEFAULT_TYPE << dec << "): ";
+      cout << "Hex code or GUID (L to show codes, Enter = " << hex << 
DEFAULT_GPT_TYPE << dec << "): ";
       line = ReadString();
       if ((line[0] == 'L') || (line[0] == 'l')) {
          partitionType.ShowAllTypes();
       } else {
          if (line.length() == 0)
-            tempType= DEFAULT_TYPE;
+            tempType = DEFAULT_GPT_TYPE;
          else
             tempType = line;
       } // if/else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/gpttext.cc 
new/gptfdisk-0.8.6/gpttext.cc
--- old/gptfdisk-0.8.5/gpttext.cc       2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/gpttext.cc       2013-01-09 17:09:33.000000000 +0100
@@ -452,7 +452,7 @@
       if (eeFirst == 'Y') {
          hybridMBR.AddPart(0, hybridPart);
       } else {
-         hybridMBR.AddPart(3, hybridPart);
+         hybridMBR.AddPart(numPartsToCvt, hybridPart);
       } // else
       hybridMBR.SetHybrid();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/parttypes.cc 
new/gptfdisk-0.8.6/parttypes.cc
--- old/gptfdisk-0.8.5/parttypes.cc     2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/parttypes.cc     2013-01-09 17:09:33.000000000 +0100
@@ -2,7 +2,7 @@
 // Class to manage partition type codes -- a slight variant on MBR type
 // codes, GUID type codes, and associated names.
 
-/* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is 
distributed
+/* This program is copyright (c) 2009-2012 by Roderick W. Smith. It is 
distributed
   under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
 
 #define __STDC_LIMIT_MACROS
@@ -72,7 +72,8 @@
    // on empty partition table entries....
    AddType(0x0000, "00000000-0000-0000-0000-000000000000", "Unused entry", 0);
 
-   // DOS/Windows partition types, which confusingly Linux also uses in GPT
+   // DOS/Windows partition types, most of which are hidden from the "L" 
listing
+   // (they're available mainly for MBR-to-GPT conversions).
    AddType(0x0100, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic 
data", 0); // FAT-12
    AddType(0x0400, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic 
data", 0); // FAT-16 < 32M
    AddType(0x0600, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic 
data", 0); // FAT-16
@@ -106,7 +107,7 @@
    AddType(0x7f02, "2E0A753D-9E48-43B0-8337-B15192CB1B5E", "ChromeOS 
reserved");
 
    // Linux-specific partition types....
-   AddType(0x8200, "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F", "Linux swap"); // 
Linux swap (or Solaris)
+   AddType(0x8200, "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F", "Linux swap"); // 
Linux swap (or Solaris on MBR)
    AddType(0x8300, "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "Linux 
filesystem"); // Linux native
    AddType(0x8301, "8DA63339-0007-60C0-C436-083AC8230908", "Linux reserved");
    AddType(0x8e00, "E6D6D379-F507-44C2-A23C-238F2A3DF928", "Linux LVM");
@@ -171,10 +172,18 @@
    AddType(0xc001, "75894C1E-3AEB-11D3-B7C1-7B03A0000000", "HP-UX data");
    AddType(0xc002, "E2A1E728-32E3-11D6-A682-7B03A0000000", "HP-UX service");
 
+   // Sony uses this GUID on some of its computers.
+   AddType(0xed00, "F4019732-066E-4E12-8273-346C5641494F", "Sony system 
partition");
+
    // EFI system and related partitions
    AddType(0xef00, "C12A7328-F81F-11D2-BA4B-00A0C93EC93B", "EFI System"); // 
Parted identifies these as having the "boot flag" set
    AddType(0xef01, "024DEE41-33E7-11D3-9D69-0008C781F39F", "MBR partition 
scheme"); // Used to nest MBR in GPT
-   AddType(0xef02, "21686148-6449-6E6F-744E-656564454649", "BIOS boot 
partition"); // Boot loader
+   AddType(0xef02, "21686148-6449-6E6F-744E-656564454649", "BIOS boot 
partition"); // Used by GRUB
+
+   // VMWare ESX partition types codes
+   AddType(0xfb00, "AA31E02A-400F-11DB-9590-000C2911D1B8", "VMWare VMFS");
+   AddType(0xfb01, "9198EFFC-31C0-11DB-8F78-000C2911D1B8", "VMWare reserved");
+   AddType(0xfc00, "9D275380-40AD-11DB-BF97-000C2911D1B8", "VMWare kcore crash 
protection");
 
    // A straggler Linux partition type....
    AddType(0xfd00, "A19D880F-05FC-4D3B-A006-743F0F84911E", "Linux RAID");
@@ -250,7 +259,7 @@
    } // while
    if (!found) {
       // Assign a default value....
-      operator=(DEFAULT_TYPE);
+      operator=(DEFAULT_GPT_TYPE);
       cout.setf(ios::uppercase);
       cout.fill('0');
       cout << "Exact type match not found for type code ";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/sgdisk.8 new/gptfdisk-0.8.6/sgdisk.8
--- old/gptfdisk-0.8.5/sgdisk.8 2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/sgdisk.8 2013-01-09 17:09:33.000000000 +0100
@@ -1,6 +1,6 @@
-.\" Copyright 2011, 2012 Roderick W. Smith ([email protected])
+.\" Copyright 2011-2013 Roderick W. Smith ([email protected])
 .\" May be distributed under the GNU General Public License
-.TH "SGDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "SGDISK" "8" "0.8.6" "Roderick W. Smith" "GPT fdisk Manual"
 .SH "NAME"
 sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and 
Unix
 .SH "SYNOPSIS"
@@ -490,7 +490,7 @@
 Disk replication operation (-R) failed
 
 .SH "BUGS"
-As of May 2012 (version 0.8.5), \fBsgdisk\fR
+As of January 2013 (version 0.8.6), \fBsgdisk\fR
 should be considered beta software. Known bugs and limitations include:
 
 .TP 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/sgdisk.html 
new/gptfdisk-0.8.6/sgdisk.html
--- old/gptfdisk-0.8.5/sgdisk.html      2012-05-30 17:38:43.000000000 +0200
+++ new/gptfdisk-0.8.6/sgdisk.html      2013-01-09 17:09:33.000000000 +0100
@@ -3,7 +3,7 @@
 <HTML><HEAD><TITLE>Manpage of SGDISK</TITLE>
 </HEAD><BODY>
 <H1>SGDISK</H1>
-Section: GPT fdisk Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
+Section: GPT fdisk Manual (8)<BR>Updated: 0.8.6<BR><A HREF="#index">Index</A>
 <A HREF="http://localhost/cgi-bin/man/man2html";>Return to Main Contents</A><HR>
 
 <A NAME="lbAB">&nbsp;</A>
@@ -563,7 +563,7 @@
 <A NAME="lbAG">&nbsp;</A>
 <H2>BUGS</H2>
 
-As of May 2012 (version 0.8.5), <B>sgdisk</B>
+As of January 2013 (version 0.8.6), <B>sgdisk</B>
 should be considered beta software. Known bugs and limitations include:
 <P>
 <DL COMPACT>
@@ -711,6 +711,6 @@
 This document was created by
 <A HREF="http://localhost/cgi-bin/man/man2html";>man2html</A>,
 using the manual pages.<BR>
-Time: 15:38:43 GMT, May 30, 2012
+Time: 16:09:33 GMT, January 09, 2013
 </BODY>
 </HTML>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gptfdisk-0.8.5/support.h new/gptfdisk-0.8.6/support.h
--- old/gptfdisk-0.8.5/support.h        2012-05-30 17:38:42.000000000 +0200
+++ new/gptfdisk-0.8.6/support.h        2013-01-09 17:09:33.000000000 +0100
@@ -8,7 +8,7 @@
 #ifndef __GPTSUPPORT
 #define __GPTSUPPORT
 
-#define GPTFDISK_VERSION "0.8.5"
+#define GPTFDISK_VERSION "0.8.6"
 
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined 
(__APPLE__)
 // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no 
lseek64
@@ -17,15 +17,19 @@
 #endif
 
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
-#define DEFAULT_TYPE 0xA503
+#define DEFAULT_GPT_TYPE 0xA503
 #endif
 
 #ifdef __APPLE__
-#define DEFAULT_TYPE 0xAF00
+#define DEFAULT_GPT_TYPE 0xAF00
 #endif
 
 #ifdef _WIN32
-#define DEFAULT_TYPE 0x0700
+#define DEFAULT_GPT_TYPE 0x0700
+#endif
+
+#ifdef __sun__
+#define DEFAULT_GPT_TYPE 0xbf01
 #endif
 
 // Microsoft Visual C++ only
@@ -38,11 +42,11 @@
 // Linux only....
 #ifdef __linux__
 #include <linux/fs.h>
-#define DEFAULT_TYPE 0x8300
+#define DEFAULT_GPT_TYPE 0x8300
 #endif
 
-#ifndef DEFAULT_TYPE
-#define DEFAULT_TYPE 0x8300
+#ifndef DEFAULT_GPT_TYPE
+#define DEFAULT_GPT_TYPE 0x8300
 #endif
 
 // Set this as a default

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to