Fix confirm() to handle EOF

Signed-off-by: Federico Hernandez <ultrafredde@gmail.com>
This commit is contained in:
Pietro Cerutti 2009-10-21 22:15:20 +02:00 committed by Federico Hernandez
parent b3d40b2554
commit fdb359c180

View file

@ -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