1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

2000-02-17

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-02-17 07:11:22 +00:00
parent 7dd3853eac
commit 96b40dff45
27 changed files with 286 additions and 171 deletions

View file

@ -340,6 +340,13 @@ rb_str_modify(str)
RSTRING(str)->orig = 0;
}
VALUE
rb_str_freeze(str)
VALUE str;
{
return rb_obj_freeze(str);
}
VALUE
rb_str_dup_frozen(str)
VALUE str;
@ -561,6 +568,10 @@ rb_str_index_m(argc, argv, str)
else {
pos = 0;
}
if (pos < 0) {
pos += RSTRING(str)->len;
if (pos < 0) return Qnil;
}
switch (TYPE(sub)) {
case T_REGEXP: