Skip to content

Commit

Permalink
Fix StringIO#read
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Sep 20, 2013
1 parent ddd0778 commit aebb1f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stdlib/stringio.rb
Expand Up @@ -118,8 +118,10 @@ def read(length = nil, outbuf = nil)

string = if length
@string[@position, length]
@position += length
else
@string[@position .. -1]
@position = @string.length
end

if outbuf
Expand Down

0 comments on commit aebb1f8

Please sign in to comment.