summaryrefslogtreecommitdiff
path: root/gpttext.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2012-03-25 16:13:16 -0400
committersrs5694 <srs5694@users.sourceforge.net>2012-03-25 16:13:16 -0400
commita6297b8a2c24adc5aa6dcd03cdc766368cda898d (patch)
tree7f1dc43989bab06828df05388048f32a51bbdd7e /gpttext.cc
parent3488294d718a0e8b7f312c80c9e5729671173f6a (diff)
downloadsgdisk-a6297b8a2c24adc5aa6dcd03cdc766368cda898d.tar.gz
Fix Ctrl+D problems; 0.8.4 release
Diffstat (limited to 'gpttext.cc')
-rw-r--r--gpttext.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gpttext.cc b/gpttext.cc
index 2f30356..506c0f1 100644
--- a/gpttext.cc
+++ b/gpttext.cc
@@ -25,6 +25,7 @@
#include <stdint.h>
#include <limits.h>
#include <iostream>
+#include <fstream>
#include <sstream>
#include <cstdio>
#include "attributes.h"
@@ -509,12 +510,12 @@ void GPTDataTextUI::MainMenu(string filename) {
int goOn = 1;
PartType typeHelper;
uint32_t temp1, temp2;
-
+
do {
cout << "\nCommand (? for help): ";
switch (ReadString()[0]) {
case '\0':
- goOn = !cin.eof();
+ goOn = cin.good();
break;
case 'b': case 'B':
cout << "Enter backup filename to save: ";
@@ -610,7 +611,7 @@ void GPTDataTextUI::RecoveryMenu(string filename) {
cout << "\nRecovery/transformation command (? for help): ";
switch (ReadString()[0]) {
case '\0':
- goOn = !cin.eof();
+ goOn = cin.good();
break;
case 'b': case 'B':
RebuildMainHeader();
@@ -736,6 +737,7 @@ void GPTDataTextUI::ExpertsMenu(string filename) {
cout << "\nExpert command (? for help): ";
switch (ReadString()[0]) {
case '\0':
+ goOn = cin.good();
break;
case 'a': case 'A':
if (GetPartRange(&temp1, &temp2) > 0)