Skip to content

Commit

Permalink
* rb_enc_get_index: allows an arbitrary RData as the argument but not
Browse files Browse the repository at this point in the history
  only what points a rb_encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yugui committed May 20, 2009
1 parent 9d0add0 commit a1b5cd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Wed May 20 21:00:27 2009 Yuki Sonoda (Yugui) <[email protected]>

* 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) <[email protected]>

* spec/.gitignore: ignores rubyspec/ and mspec/.
Expand Down
4 changes: 4 additions & 0 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit a1b5cd1

Please sign in to comment.