* marshal.c (r_object0): register regexp object before encoding
name. [ruby-dev:40414] * re.c (rb_reg_alloc, rb_reg_init_str): split from rb_reg_new_str. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be0197054c
commit
27e492bec7
@ -1,3 +1,10 @@
|
|||||||
|
Sun Feb 14 04:45:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (r_object0): register regexp object before encoding
|
||||||
|
name. [ruby-dev:40414]
|
||||||
|
|
||||||
|
* re.c (rb_reg_alloc, rb_reg_init_str): split from rb_reg_new_str.
|
||||||
|
|
||||||
Sat Feb 13 17:07:20 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Feb 13 17:07:20 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* array.c (rb_ary_delete): RDoc update. a patch from Hugh Sasse.
|
* array.c (rb_ary_delete): RDoc update. a patch from Hugh Sasse.
|
||||||
|
@ -553,6 +553,8 @@ VALUE rb_reg_match_last(VALUE);
|
|||||||
#define HAVE_RB_REG_NEW_STR 1
|
#define HAVE_RB_REG_NEW_STR 1
|
||||||
VALUE rb_reg_new_str(VALUE, int);
|
VALUE rb_reg_new_str(VALUE, int);
|
||||||
VALUE rb_reg_new(const char *, long, int);
|
VALUE rb_reg_new(const char *, long, int);
|
||||||
|
VALUE rb_reg_alloc(void);
|
||||||
|
VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
|
||||||
VALUE rb_reg_match(VALUE, VALUE);
|
VALUE rb_reg_match(VALUE, VALUE);
|
||||||
VALUE rb_reg_match2(VALUE);
|
VALUE rb_reg_match2(VALUE);
|
||||||
int rb_reg_options(VALUE);
|
int rb_reg_options(VALUE);
|
||||||
|
@ -1495,6 +1495,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
|
|||||||
int options = r_byte(arg);
|
int options = r_byte(arg);
|
||||||
int has_encoding = FALSE;
|
int has_encoding = FALSE;
|
||||||
|
|
||||||
|
v = r_entry(rb_reg_alloc(), arg);
|
||||||
if (ivp) {
|
if (ivp) {
|
||||||
r_ivar(str, &has_encoding, arg);
|
r_ivar(str, &has_encoding, arg);
|
||||||
*ivp = FALSE;
|
*ivp = FALSE;
|
||||||
@ -1518,7 +1519,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
|
|||||||
}
|
}
|
||||||
rb_str_set_len(str, dst - ptr);
|
rb_str_set_len(str, dst - ptr);
|
||||||
}
|
}
|
||||||
v = r_entry(rb_reg_new_str(str, options), arg);
|
v = r_entry(rb_reg_init_str(v, str, options), arg);
|
||||||
v = r_leave(v, arg);
|
v = r_leave(v, arg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
17
re.c
17
re.c
@ -2418,10 +2418,21 @@ rb_reg_s_alloc(VALUE klass)
|
|||||||
return (VALUE)re;
|
return (VALUE)re;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_reg_alloc(void)
|
||||||
|
{
|
||||||
|
return rb_reg_s_alloc(rb_cRegexp);
|
||||||
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_reg_new_str(VALUE s, int options)
|
rb_reg_new_str(VALUE s, int options)
|
||||||
{
|
{
|
||||||
VALUE re = rb_reg_s_alloc(rb_cRegexp);
|
return rb_reg_init_str(rb_reg_alloc(), s, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_reg_init_str(VALUE re, VALUE s, int options)
|
||||||
|
{
|
||||||
onig_errmsg_buffer err = "";
|
onig_errmsg_buffer err = "";
|
||||||
|
|
||||||
if (rb_reg_initialize_str(re, s, options, err, NULL, 0) != 0) {
|
if (rb_reg_initialize_str(re, s, options, err, NULL, 0) != 0) {
|
||||||
@ -2440,7 +2451,7 @@ rb_reg_new_ary(VALUE ary, int opt)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_enc_reg_new(const char *s, long len, rb_encoding *enc, int options)
|
rb_enc_reg_new(const char *s, long len, rb_encoding *enc, int options)
|
||||||
{
|
{
|
||||||
VALUE re = rb_reg_s_alloc(rb_cRegexp);
|
VALUE re = rb_reg_alloc();
|
||||||
onig_errmsg_buffer err = "";
|
onig_errmsg_buffer err = "";
|
||||||
|
|
||||||
if (rb_reg_initialize(re, s, len, enc, options, err, NULL, 0) != 0) {
|
if (rb_reg_initialize(re, s, len, enc, options, err, NULL, 0) != 0) {
|
||||||
@ -2459,7 +2470,7 @@ rb_reg_new(const char *s, long len, int options)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
|
rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
|
||||||
{
|
{
|
||||||
VALUE re = rb_reg_s_alloc(rb_cRegexp);
|
VALUE re = rb_reg_alloc();
|
||||||
onig_errmsg_buffer err = "";
|
onig_errmsg_buffer err = "";
|
||||||
|
|
||||||
if (!str) str = rb_str_new(0,0);
|
if (!str) str = rb_str_new(0,0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user