* bug #11640 fixed - Plug back the same behavior as 5.3.3 when STDIN is closed. 49/8549/3
Sylvestre Ledru [Sun, 5 Aug 2012 21:48:44 +0000 (23:48 +0200)]
Thanks Calixte

Change-Id: I86de12f719f26b729ac9c6dfaa321ec2be5993cc

scilab/CHANGES_5.4.X
scilab/modules/console/src/c/cmdLine/getKey.c

index fb0f3d6..35a9cb9 100644 (file)
@@ -42,6 +42,8 @@ Bug Fixes
 
 * Bug #11628 fixed - Clearing a shortcut did not work is Preferences.
 
+* Bug #11640 fixed - Plug back the same behavior as 5.3.3 when STDIN is closed.
+
 * Bug #11641 fixed - In xmltoformat, parsing of the CHAPTER files was too strict.
 
 * Bug #11647 fixed - The phrase "The system cannot find the file specified." in
index fbcd4d5..4348d0a 100644 (file)
@@ -164,13 +164,21 @@ static void endCopyPast(wchar_t * commandLine)
     int sizeOfCmd = 0;
 
     sizeOfCmd = wcslen(commandLine);
-    if (commandLine[sizeOfCmd - 1] == L'\n')
+
+    if (sizeOfCmd == 0)
     {
         setTokenInteruptExecution(SEND_COMMAND);
     }
     else
     {
-        setTokenInteruptExecution(CONTINUE_COMMAND);
+        if (commandLine[sizeOfCmd - 1] == L'\n')
+        {
+            setTokenInteruptExecution(SEND_COMMAND);
+        }
+        else
+        {
+            setTokenInteruptExecution(CONTINUE_COMMAND);
+        }
     }
 }