Fix ReadCharFromStdinBlocking

This commit is contained in:
Fangrui Song 2018-01-15 00:00:29 -08:00
parent 96a23bc573
commit 159b0b968d

View File

@ -107,9 +107,10 @@ TEST_SUITE("FindIncludeLine") {
} }
optional<char> ReadCharFromStdinBlocking() { optional<char> ReadCharFromStdinBlocking() {
char c = 0; char c;
std::cin.read(&c, 1); if (std::cin.read(&c, 1))
return c; return c;
return nullopt;
} }
std::unique_ptr<BaseIpcMessage> MessageRegistry::ReadMessageFromStdin( std::unique_ptr<BaseIpcMessage> MessageRegistry::ReadMessageFromStdin(