Fix confirm() to handle EOF
Signed-off-by: Federico Hernandez <ultrafredde@gmail.com>
This commit is contained in:
committed by
Federico Hernandez
parent
b3d40b2554
commit
fdb359c180
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user