[CM] standard input EOF in console app s7

Tito Latini tito.01beta at gmail.com
Thu Feb 20 09:13:02 PST 2014


s7> [Ctrl-d]
s7>
s7>
s7>
s7>
... forever ...

[Ctrl-c]

GUI side: if a grace-ful musician accidentally clicks on the
executable, the loop continues to write "\ns7> " in background.

diff -ur cm~/src/s7.cpp cm/src/s7.cpp
--- cm~/src/s7.cpp	2014-02-20 16:46:11.069524177 +0100
+++ cm/src/s7.cpp	2014-02-20 16:46:25.488342908 +0100
@@ -37,7 +37,7 @@
   std::string str;
   try 
   {
-    while (true)
+    while (std::cin)
     {
       std::cout << "\ns7> ";
       str = "";


s7 <<< :ok
s7> :ok
s7> Bye!



More information about the Cmdist mailing list