diff options
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-windows.tmpl | 4 | ||||
-rw-r--r-- | src/library/scala/Predef.scala | 2 | ||||
-rw-r--r-- | test/files/run/Predef.readLine.check | 3 | ||||
-rw-r--r-- | test/files/run/Predef.readLine.scala | 10 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl index 9f1fbc4524..5949689b24 100644 --- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl @@ -86,4 +86,6 @@ goto :eof :end
@@endlocal
-exit /b %errorlevel%
+
+REM exit code fix, see http://stackoverflow.com/questions/4632891/exiting-batch-with-exit-b-x-where-x-1-acts-as-if-command-completed-successfu
+@@%COMSPEC% /C exit %errorlevel% >nul
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index b175fb9e1d..824e048e73 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -269,7 +269,7 @@ object Predef extends LowPriorityImplicits { def printf(text: String, xs: Any*) = Console.print(text.format(xs: _*)) def readLine(): String = Console.readLine() - def readLine(text: String, args: Any*) = Console.readLine(text, args) + def readLine(text: String, args: Any*) = Console.readLine(text, args: _*) def readBoolean() = Console.readBoolean() def readByte() = Console.readByte() def readShort() = Console.readShort() diff --git a/test/files/run/Predef.readLine.check b/test/files/run/Predef.readLine.check new file mode 100644 index 0000000000..4fb2bc4c6a --- /dev/null +++ b/test/files/run/Predef.readLine.check @@ -0,0 +1,3 @@ +prompt +fancy prompt +immensely fancy prompt
\ No newline at end of file diff --git a/test/files/run/Predef.readLine.scala b/test/files/run/Predef.readLine.scala new file mode 100644 index 0000000000..9f07936638 --- /dev/null +++ b/test/files/run/Predef.readLine.scala @@ -0,0 +1,10 @@ +import java.io.StringReader + +object Test extends App { + Console.withIn(new StringReader("")) { + readLine() + readLine("prompt\n") + readLine("%s prompt\n", "fancy") + readLine("%s %s prompt\n", "immensely", "fancy") + } +}
\ No newline at end of file |