Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/argf/read_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
slow:ARGF.read reads the contents of stdin
slow:ARGF.read reads a number of bytes from stdin
slow:ARGF.read reads the contents of one file and stdin
fails:ARGF.read clears output buffer before appending to it
7 changes: 6 additions & 1 deletion truffle/src/main/ruby/core/argf.rb
Original file line number Diff line number Diff line change
@@ -366,7 +366,12 @@ def readbyte
#
def read(bytes=nil, output=nil)
# The user might try to pass in nil, so we have to check here
output ||= default_value
if output.nil?
output = default_value
else
output = StringValue(output)
output.delete!("^*") # rb_str_resize(str,0);

This comment has been minimized.

Copy link
@eregon

eregon Sep 6, 2016

Member

Why not just .clear ?

This comment has been minimized.

Copy link
@bjfish

bjfish Sep 6, 2016

Contributor

@eregon Fixed at faf9735, Thanks

end

if bytes
bytes_left = bytes

0 comments on commit 137f0f1

Please sign in to comment.