[Bug #2179] 1.9.2$B$K$*$$$F(B block $B$N%9%3!<%W$,$*$+$7$$$H$-$,$"$k(B

Bug #2179: 1.9.2e$B$K$$$$Fe(B block
e$B$N%9%3!<%W$,$
$+$7$$$H$-$,$"$ke(B
http://redmine.ruby-lang.org/issues/show/2179

e$B5/I<<Te(B: e$B1WN4e(B e$B;0B<e(B
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
ruby -v: ruby 1.9.2dev (2009-10-06 trunk 25243) [i386-darwin9.8.0]

rubyspece$B$rN.$7$F$$$k$H$-$K5$$E$$$?$N$G$9$,!"e(B
ruby1.9.2 e$B$Ne(B trunk(rev 25243) e$B$K$Fe(B
blocke$B$N%9%3!<%W$,@5$7$/F0$$$F$J$$$h$&$K8+$($^$9!#e(B

e$BBP1~$9$ke(Brubyspece$B$Oe(B core/string/upto_spec.rb:21

% ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
% irb
ruby-1.9.1-p243 > a=[]; “25”.upto(“5”){|s|a<<s}; a
=> [“25”]

% ruby -v
ruby 1.9.2dev (2009-10-06 trunk 25243) [i386-darwin9.8.0]
% irb
ruby-1.9.2-head > a=[]; “25”.upto(“5”){|s|a<<s}; a
=> []

e$B$?$@$7!"0J2<$N%1!<%9$@$H@5$7$/F0$$$F$$$k$h$&$G$9!#e(B
ruby-1.9.2-head > a=[]; (1…10).each{|i| a<<i}; a
=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

e$B$$$^$$$G$9!#e(B

From: e$B1WN4e(B e$B;0B<e(B <redmine_at_ruby-lang.org>
Date: Tue, 6 Oct 2009 21:14:10 +0900

ruby 1.9.2dev (2009-10-06 trunk 25243) [i386-darwin9.8.0]
% irb
ruby-1.9.2-head > a=[]; “25”.upto(“5”){|s|a<<s}; a
=> []

e$B$3$l$O%V%m%C%/$,0lEY$bI>2A$5$l$F$J$$$+$i$G$9$M!#e(B

$ ruby1.9.1 -ve ‘“25”.upto(“5”){raise}’
ruby 1.9.1p243 (2009-07-16 revision 24175) [i486-linux]
-e:1:in block in <main>': unhandled exception from -e:1:in upto’
from -e:1:in `’
$ ruby1.9 -ve ‘“25”.upto(“5”){raise}’
ruby 1.9.2dev (2009-10-03 trunk 25201) [i686-linux]

e$BN>C<$,?tCM$H$$J$;$k$H$-$Ne(B String#upto
e$B$N5sF0$NJQ99$K$h$k$b$N$@$H;W$$e(B
e$B$^$9!#$3$l$O=q$$$F$*$$$?J}$,$h$$$H;W$&$N$G!"%Q%C%A$r=q$$$F$
$^$7$?!#e(B

Nobuhiro IMAI [email protected]
Key fingerprint = F39E D552 545D 7C64 D690 F644 5A15 746C BD8E 7106

Index: string.c

— string.c (revision 25243)
+++ string.c (working copy)
@@ -2863,6 +2863,14 @@
*

  • a8 a9 b0 b1 b2 b3 b4 b5 b6
    
  • a8 a9 b0 b1 b2 b3 b4 b5 b6
    
    • If str and other_str contains only ascii numeric
      characters,
    • both are recognized as decimal numbers. In addition, the width of
    • string (e.g. leading zeros) is handled appropriately.
    • "9".upto("11").to_a   => ["9", "10", "11"]
      
    • "25".upto("5").to_a   => []
      
    • "07".upto("11").to_a  => ["07", "08", "09", "10", "11"]
      
    */

static VALUE

e$B%A%1%C%He(B #2179 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r25249.

http://redmine.ruby-lang.org/issues/show/2179

e$B%_%`%i$G$9!#e(B

2009e$BG/e(B10e$B7ne(B6e$BF|e(B22:04 Nobuhiro IMAI [email protected]:

e$B$^$9!#$3$l$O=q$$$F$*$$$?J}$,$h$$$H;W$&$N$G!“%Q%C%A$r=q$$$F$_$^$7$?!#e(B
e$B$J$k$[$I!#?tCM$N$H$-$N5sF0$K9g$o$;$k$h$&$K$J$C$F$$$?$N$G$9$M!#e(B
e$BBP1~$”$j$,$H$&$4$6$$$^$7$?!#e(B