From fdb359c180866a486bab75071b32b16f1c6ed534 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Wed, 21 Oct 2009 22:15:20 +0200 Subject: [PATCH] Fix confirm() to handle EOF Signed-off-by: Federico Hernandez --- src/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 76ebd1312..75938a318 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -64,7 +64,7 @@ bool confirm (const std::string& question) << " "; std::getline (std::cin, answer); - answer = lowerCase (trim (answer)); + answer = std::cin.eof() ? "no" : lowerCase (trim (answer)); } while (answer != "y" && // TODO i18n answer != "ye" && // TODO i18n