From: Kevin M. Rosenberg Date: Wed, 21 Mar 2018 21:20:28 +0000 (-0600) Subject: Exit on EOF X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=728543fba0d875b2977ea2b6562df1ee4a6af8f7 Exit on EOF --- diff --git a/tools/ctsimtext.cpp b/tools/ctsimtext.cpp index 5a569c4..e1695b1 100644 --- a/tools/ctsimtext.cpp +++ b/tools/ctsimtext.cpp @@ -145,6 +145,10 @@ ctsimtext_main (int argc, char * argv[]) char* pszInputLine = new char [s_MaxLineLength+1]; std::cout << szPrompt; std::cin.getline (pszInputLine, s_MaxLineLength); + if (std::cin.eof()) { + std::cout << "\n"; + break; + } #ifdef DEBUG std::cout << "#" << pszInputLine << "#\n";