diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-20 12:16:23 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-20 12:16:23 +0000 |
| commit | cefeb0719c5dc68f6666289de646043bdec82c63 (patch) | |
| tree | cdb37862f21ad5f8726070a587ebda5047e835d7 | |
| parent | 6477a57c9ba24d0a15bc9188a55751de9ff71cf5 (diff) | |
| download | ruby-cefeb0719c5dc68f6666289de646043bdec82c63.tar.gz ruby-cefeb0719c5dc68f6666289de646043bdec82c63.tar.xz ruby-cefeb0719c5dc68f6666289de646043bdec82c63.zip | |
* rb_enc_get_index: allows an arbitrary RData as the argument but not
only what points a rb_encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | encoding.c | 4 |
2 files changed, 9 insertions, 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/. diff --git a/encoding.c b/encoding.c index 4ef45cd65..574193a96 100644 --- a/encoding.c +++ b/encoding.c @@ -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; |
