diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-08-12 12:16:31 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-08-12 12:16:31 -0700 |
| commit | 0143a85a21027f0f171abb1d00a2e000a364671c (patch) | |
| tree | e6dcb9229b4aef70396432daaf3864d0ce6fa8ad | |
| parent | 26a75d854b2b39469ed7b527ea646bca0b57a8f8 (diff) | |
| parent | 44b408ad10f671df4dec99d0ef0f6a794c09240d (diff) | |
| download | mruby-0143a85a21027f0f171abb1d00a2e000a364671c.tar.gz mruby-0143a85a21027f0f171abb1d00a2e000a364671c.zip | |
Merge pull request #421 from masamitsu-murase/modify_puts
`puts` should print "\n" only when the argument does not end with "\n".
| -rw-r--r-- | mrblib/print.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mrblib/print.rb b/mrblib/print.rb index dea088e2b..9183f6bb2 100644 --- a/mrblib/print.rb +++ b/mrblib/print.rb @@ -48,8 +48,9 @@ module Kernel i = 0 len = args.size while i < len - __printstr__ args[i].to_s - __printstr__ "\n" + s = args[i].to_s + __printstr__ s + __printstr__ "\n" if (s[-1] != "\n") i += 1 end __printstr__ "\n" if len == 0 |
