aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-20 12:16:23 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-20 12:16:23 +0000
commita1b5cd1ca2fed8844d69631a2574e3a79f61ab87 (patch)
treecdb37862f21ad5f8726070a587ebda5047e835d7
parent9d0add09cf224279e084f413333bca152f1a25b7 (diff)
downloadruby-a1b5cd1ca2fed8844d69631a2574e3a79f61ab87.tar.gz
* 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
-rw-r--r--ChangeLog5
-rw-r--r--encoding.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9cb4803f2f..818288ccf8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;