ruby-changes:32117
From: nobu <ko1@a...>
Date: Sat, 14 Dec 2013 11:55:42 +0900 (JST)
Subject: [ruby-changes:32117] nobu:r44196 (trunk): scanf.rb: fix rescue modifier
nobu 2013-12-14 11:55:33 +0900 (Sat, 14 Dec 2013) New Revision: 44196 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44196 Log: scanf.rb: fix rescue modifier * lib/scanf.rb (IO#scanf): fix mistaken use of rescue modifier. a patch by Mon_Ouie at [ruby-core:52813]. [Bug #7940] Modified files: trunk/ChangeLog trunk/lib/scanf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 44195) +++ ChangeLog (revision 44196) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Dec 14 11:55:31 2013 Nobuyoshi Nakada <nobu@r...> + + * lib/scanf.rb (IO#scanf): fix mistaken use of rescue modifier. + a patch by Mon_Ouie at [ruby-core:52813]. [Bug #7940] + Sat Dec 14 11:44:52 2013 Nobuyoshi Nakada <nobu@r...> * util.c (ruby_qsort): fix potential stack overflow on a large Index: lib/scanf.rb =================================================================== --- lib/scanf.rb (revision 44195) +++ lib/scanf.rb (revision 44196) @@ -657,7 +657,12 @@ class IO https://github.com/ruby/ruby/blob/trunk/lib/scanf.rb#L657 break if fstr.last_spec fstr.prune end - seek(start_position + matched_so_far, IO::SEEK_SET) rescue Errno::ESPIPE + + begin + seek(start_position + matched_so_far, IO::SEEK_SET) + rescue Errno::ESPIPE + end + soak_up_spaces if fstr.last_spec && fstr.space return final_result -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/