mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* rb_enc_get_index: allows an arbitrary RData as the argument but not
only what points a rb_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d0add09cf
commit
a1b5cd1ca2
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed May 20 21:00:27 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* rb_enc_get_index: allows an arbitrary RData as the argument but not
|
||||
only what points a rb_encoding.
|
||||
|
||||
Wed May 20 20:54:37 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* spec/.gitignore: ignores rubyspec/ and mspec/.
|
||||
|
|
|
@ -566,6 +566,7 @@ rb_enc_get_index(VALUE obj)
|
|||
VALUE tmp;
|
||||
|
||||
switch (BUILTIN_TYPE(obj)) {
|
||||
as_default:
|
||||
default:
|
||||
case T_STRING:
|
||||
case T_REGEXP:
|
||||
|
@ -586,6 +587,9 @@ rb_enc_get_index(VALUE obj)
|
|||
if (RDATA(obj)->dmark == enc_mark) {
|
||||
i = enc_check_encoding(obj);
|
||||
}
|
||||
else {
|
||||
goto as_default;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
|
Loading…
Reference in a new issue