From c62127af082350eae40fcddc6d16780310312a20 Mon Sep 17 00:00:00 2001 From: Janico Greifenberg Date: Tue, 22 Jul 2008 16:51:41 +0200 Subject: [PATCH] StringIO#each_byte now increments the position before calling yied. --- lib/stringio.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/stringio.rb b/lib/stringio.rb index 96b8114..bd777a4 100644 --- a/lib/stringio.rb +++ b/lib/stringio.rb @@ -115,7 +115,7 @@ class StringIO def each_byte raise IOError, "not opened for reading" unless @readable - @string[@pos..-1].each_byte { |b| yield b } + @string[@pos..-1].each_byte { |b| @pos += 1; yield b} nil end -- 1.5.4.3