aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderick W. Smith <rodsmith@rodsbooks.com>2014-03-29 00:45:59 -0400
committerRoderick W. Smith <rodsmith@rodsbooks.com>2014-03-29 00:45:59 -0400
commita920398fa393f9d6301b32b191bc01e086ab8bc8 (patch)
tree350b451cd05f4dbb3baac9e073e224136db0d137
parentf694803eca2074523b8e502d386ca03b5642a63b (diff)
downloadgptfdisk-a920398fa393f9d6301b32b191bc01e086ab8bc8.tar.gz
Fixed bug that caused spurious "1" exit condition in gdisk. Also
modified Windows warning text in light of common use of GPT on Windows 8 and 8.1.
-rw-r--r--gdisk.cc7
-rw-r--r--support.cc10
2 files changed, 11 insertions, 6 deletions
diff --git a/gdisk.cc b/gdisk.cc
index a6ea2e9..5f85498 100644
--- a/gdisk.cc
+++ b/gdisk.cc
@@ -15,6 +15,7 @@ int main(int argc, char* argv[]) {
GPTDataTextUI theGPT;
string device = "";
UnicodeString uString;
+ int isError = 0;
#ifndef EFI
cout << "GPT fdisk (gdisk) version " << GPTFDISK_VERSION << "\n\n";
@@ -49,16 +50,20 @@ int main(int argc, char* argv[]) {
device = (string) argv[1];
} else { // 3 arguments, but none is "-l"
cerr << "Usage: " << argv[0] << " [-l] device_file\n";
+ isError = 1;
} // if/elseif/else
if (device != "") {
theGPT.JustLooking();
if (theGPT.LoadPartitions(device))
theGPT.DisplayGPTData();
+ else
+ isError = 1;
} // if
break;
default:
cerr << "Usage: " << argv[0] << " [-l] device_file\n";
+ isError = 1;
break;
} // switch
- return 1 ;
+ return (isError);
} // main
diff --git a/support.cc b/support.cc
index 2dc9a8a..8c56c91 100644
--- a/support.cc
+++ b/support.cc
@@ -328,11 +328,11 @@ void ReverseBytes(void* theValue, int numBytes) {
void WinWarning(void) {
#ifdef _WIN32
cout << "\a************************************************************************\n"
- << "Most versions of Windows cannot boot from a GPT disk, and most varieties\n"
- << "prior to Vista cannot read GPT disks. Therefore, you should exit now\n"
- << "unless you understand the implications of converting MBR to GPT or creating\n"
- << "a new GPT disk layout!\n"
- << "************************************************************************\n\n";
+ << "Most versions of Windows cannot boot from a GPT disk except on a UEFI-based\n"
+ << "computer, and most varieties prior to Vista cannot read GPT disks. Therefore,\n"
+ << "you should exit now unless you understand the implications of converting MBR\n"
+ << "to GPT or creating a new GPT disk layout!\n"
+ << "************************************************************************\n\n";
cout << "Are you SURE you want to continue? ";
if (GetYN() != 'Y')
exit(0);