From: Sylvestre Ledru Date: Sun, 5 Aug 2012 21:48:44 +0000 (+0200) Subject: * bug #11640 fixed - Plug back the same behavior as 5.3.3 when STDIN is closed. X-Git-Tag: 5.4.0-beta-3~207 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=ee032c0f97275c1beb34eeb95ac808fce91407c9 * bug #11640 fixed - Plug back the same behavior as 5.3.3 when STDIN is closed. Thanks Calixte Change-Id: I86de12f719f26b729ac9c6dfaa321ec2be5993cc --- diff --git a/scilab/CHANGES_5.4.X b/scilab/CHANGES_5.4.X index fb0f3d6..35a9cb9 100644 --- a/scilab/CHANGES_5.4.X +++ b/scilab/CHANGES_5.4.X @@ -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 diff --git a/scilab/modules/console/src/c/cmdLine/getKey.c b/scilab/modules/console/src/c/cmdLine/getKey.c index fbcd4d5..4348d0a 100644 --- a/scilab/modules/console/src/c/cmdLine/getKey.c +++ b/scilab/modules/console/src/c/cmdLine/getKey.c @@ -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); + } } }