From ca90461c572aff3b4d82d32eb9425a6b3db33928 Mon Sep 17 00:00:00 2001 From: anseki Date: Tue, 10 Feb 2015 22:39:14 +0900 Subject: [PATCH] Fix: The leading and trailing white spaces are removed --- lib/read.bat | 2 +- lib/read.sh | 6 +++--- lib/readline-sync.js | 3 ++- package.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/read.bat b/lib/read.bat index 7116485..c0135b6 100644 --- a/lib/read.bat +++ b/lib/read.bat @@ -6,6 +6,6 @@ if "%1"=="noechoback" ( ) else ( set /p LINE=CON ) -set /p DUM="%LINE%"/dev/tty else - read LINE "' + pathStdout + '") fi;' + @@ -120,6 +120,7 @@ function _readlineShell(noEchoBack) { shellStdout = decipher.update(fs.readFileSync(pathStdout, {encoding: 'binary'}), 'hex', encoding) + decipher.final(encoding); + shellStdout = shellStdout.replace(/^'|'$/g, ''); } fs.unlinkSync(pathStdout); diff --git a/package.json b/package.json index 94c7b96..09ad721 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readline-sync", - "version": "0.5.2", + "version": "0.5.3", "title": "readlineSync", "description": "Synchronous Readline", "keywords": [