diff options
-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 4ef45cd65e..574193a96f 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; |