* rational.c (string_to_r_internal): save and restore backref. fixed [ruby-dev:34990]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
26f26890aa
commit
01d7152157
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 13 17:06:20 2008 wanabe <s.wanabe@gmail.com>
|
||||||
|
|
||||||
|
* rational.c (string_to_r_internal): save and restore backref.
|
||||||
|
fixed [ruby-dev:34990]
|
||||||
|
|
||||||
Fri Jun 13 14:41:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jun 13 14:41:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* README.EXT.ja: update about Fixnum. reported in
|
* README.EXT.ja: update about Fixnum. reported in
|
||||||
|
@ -1274,13 +1274,15 @@ make_patterns(void)
|
|||||||
static VALUE
|
static VALUE
|
||||||
string_to_r_internal(VALUE self)
|
string_to_r_internal(VALUE self)
|
||||||
{
|
{
|
||||||
VALUE s, m;
|
VALUE s, m, backref;
|
||||||
|
|
||||||
s = f_strip(self);
|
s = f_strip(self);
|
||||||
|
|
||||||
if (RSTRING_LEN(s) == 0)
|
if (RSTRING_LEN(s) == 0)
|
||||||
return rb_assoc_new(Qnil, self);
|
return rb_assoc_new(Qnil, self);
|
||||||
|
|
||||||
|
backref = rb_backref_get();
|
||||||
|
rb_match_busy(backref);
|
||||||
m = f_match(rat_pat, s);
|
m = f_match(rat_pat, s);
|
||||||
|
|
||||||
if (!NIL_P(m)) {
|
if (!NIL_P(m)) {
|
||||||
@ -1333,8 +1335,10 @@ string_to_r_internal(VALUE self)
|
|||||||
if (!NIL_P(de))
|
if (!NIL_P(de))
|
||||||
v = f_div(v, f_to_i(de));
|
v = f_div(v, f_to_i(de));
|
||||||
|
|
||||||
|
rb_backref_set(backref);
|
||||||
return rb_assoc_new(v, re);
|
return rb_assoc_new(v, re);
|
||||||
}
|
}
|
||||||
|
rb_backref_set(backref);
|
||||||
return rb_assoc_new(Qnil, self);
|
return rb_assoc_new(Qnil, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user