summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-06 02:14:33 +0000
committerdblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-06 02:14:33 +0000
commit6062c51aa2d14f96d78a5789e1ece35c38b7cab5 (patch)
tree03884c59f933245d651eab51c1fa494bced91a69 /lib
parenta238e0f998749eade62c9c1b65b9a1c35d40ba53 (diff)
downloadruby-6062c51aa2d14f96d78a5789e1ece35c38b7cab5.tar.gz
ruby-6062c51aa2d14f96d78a5789e1ece35c38b7cab5.tar.xz
ruby-6062c51aa2d14f96d78a5789e1ece35c38b7cab5.zip
refixed the previous fix in IO#block_scanf
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/scanf.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/scanf.rb b/lib/scanf.rb
index c4da747af..e2f0d04c1 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -659,7 +659,8 @@ class IO
last_spec = fstr.last_spec
begin
current = scanf(str)
- final.push(yield(current)) unless current.empty?
+ break if current.empty?
+ final.push(yield(current))
end until eof || fstr.last_spec_tried == last_spec
return final
end