diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-11 09:44:01 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-11 09:44:01 +0100 |
commit | 139ecc525f07d83eda013a1f1d07e408fe1d4503 (patch) | |
tree | 8f71c4c60e38dd43f411d30c1553f05b37a90e07 | |
parent | 59fc37ade773f66eb05c7b2cfebe03abaf767c51 (diff) | |
parent | 81d11514f40314d8a64c009c0810f08f695b3e18 (diff) | |
download | scala-139ecc525f07d83eda013a1f1d07e408fe1d4503.tar.gz scala-139ecc525f07d83eda013a1f1d07e408fe1d4503.tar.bz2 scala-139ecc525f07d83eda013a1f1d07e408fe1d4503.zip |
Merge pull request #3504 from gkossakowski/readline-flush
readLine shold flush output before reading input
-rw-r--r-- | src/library/scala/io/StdIn.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/io/StdIn.scala b/src/library/scala/io/StdIn.scala index 36568b59b7..64836ecd6e 100644 --- a/src/library/scala/io/StdIn.scala +++ b/src/library/scala/io/StdIn.scala @@ -17,7 +17,7 @@ private[scala] trait StdIn { */ def readLine(): String = in.readLine() - /** Print formatted text to the default output and read a full line from the default input. + /** Print and flush formatted text to the default output, and read a full line from the default input. * Returns `null` if the end of the input stream has been reached. * * @param text the format of the text to print out, as in `printf`. @@ -26,6 +26,7 @@ private[scala] trait StdIn { */ def readLine(text: String, args: Any*): String = { printf(text, args: _*) + out.flush() readLine() } |