diff options
Diffstat (limited to 'lib/scanf.rb')
-rw-r--r-- | lib/scanf.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/scanf.rb b/lib/scanf.rb index 3d56e4aab..87b7e98ee 100644 --- a/lib/scanf.rb +++ b/lib/scanf.rb @@ -542,7 +542,8 @@ module Scanf @string_left = str @matched_count = 0 - @specs.each_with_index do |spec,@i| + @specs.each_with_index do |spec,i| + @i=i @last_spec_tried = spec @last_match_tried = spec.match(@string_left) break unless @last_match_tried |