From 728543fba0d875b2977ea2b6562df1ee4a6af8f7 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 21 Mar 2018 15:20:28 -0600 Subject: [PATCH] Exit on EOF --- tools/ctsimtext.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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"; -- 2.34.1