mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (is_defined): should not dump core for "defined?(())".
* eval.c (umethod_bind): recv can be an instance of descender of oklass if oklass is a Module. * hash.c (rb_hash_equal): check identiry equality first. * file.c (group_member): should check real gid only. * file.c (eaccess): do not cache euid, since effective euid may be changed via Process.euid=(). * file.c (eaccess): return -1 unless every specified access mode is permitted. * eval.c (rb_eval): while/until returns the value which is given to break. * parse.y (value_expr): using while/until/class/def as an expression is now gives a warning, not an error. * range.c (range_eqq): should compare strings based on magical increment (using String#upto), not dictionary order. * enum.c (enum_sort_by): new method for Schewartzian transformed stable sort. * variable.c (mod_av_set): detect constant overriding for built-in classes/modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e15efe7733
commit
1289a7a11f
15 changed files with 176 additions and 42 deletions
21
range.c
21
range.c
|
@ -148,6 +148,18 @@ r_gt(a,b)
|
|||
return Qfalse;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
r_eqq_str_i(i, data)
|
||||
VALUE i;
|
||||
VALUE *data;
|
||||
{
|
||||
if (rb_str_cmp(i, data[0]) == 0) {
|
||||
data[1] = Qtrue;
|
||||
rb_iter_break();
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
range_eqq(range, obj)
|
||||
VALUE range, obj;
|
||||
|
@ -168,6 +180,15 @@ range_eqq(range, obj)
|
|||
}
|
||||
return Qfalse;
|
||||
}
|
||||
else if (TYPE(beg) == T_STRING &&
|
||||
TYPE(obj) == T_STRING &&
|
||||
TYPE(end) == T_STRING) {
|
||||
VALUE data[2];
|
||||
|
||||
data[0] = obj; data[1] = Qfalse;
|
||||
rb_iterate(rb_each, range, r_eqq_str_i, (VALUE)data);
|
||||
return data[1];
|
||||
}
|
||||
else if (r_le(beg, obj)) {
|
||||
if (EXCL(range)) {
|
||||
if (r_lt(obj, end)) return Qtrue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue