Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`puts` should print "\n" only when the argument does not end with "\n".

  • Loading branch information...
commit 44b408ad10f671df4dec99d0ef0f6a794c09240d 1 parent 119b9f5
@masamitsu-murase masamitsu-murase authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 mrblib/print.rb
View
5 mrblib/print.rb
@@ -48,8 +48,9 @@ def puts(*args)
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
Please sign in to comment.
Something went wrong with that request. Please try again.