Exit on EOF
[ctsim.git] / tools / ctsimtext.cpp
index 5a569c4d70b74429829826746587cd5e9375219c..e1695b127f666d8ab34a22ce2e811a1c05b6957a 100644 (file)
@@ -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";