diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:35:04 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:35:04 +0000 |
| commit | 968f2e86273d15e8ad7eac604f8450d16e416fdd (patch) | |
| tree | d5d199f0a4b193ce1770007278f56afdcc20660a | |
| parent | 9f79faa5d5829dee1162b0fc8bc8fcd17626375c (diff) | |
merges r24422 from trunk into ruby_1_9_1.
--
* encoding.c (rb_enc_get_index): fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | encoding.c | 46 | ||||
| -rw-r--r-- | version.h | 2 |
2 files changed, 26 insertions, 22 deletions
diff --git a/encoding.c b/encoding.c index b8ad8016de..7d73244675 100644 --- a/encoding.c +++ b/encoding.c @@ -566,27 +566,31 @@ rb_enc_get_index(VALUE obj) VALUE tmp; switch (BUILTIN_TYPE(obj)) { - default: - case T_STRING: - case T_REGEXP: - i = ENCODING_GET_INLINED(obj); - if (i == ENCODING_INLINE_MAX) { - VALUE iv; - - iv = rb_ivar_get(obj, rb_id_encoding()); - i = NUM2INT(iv); - } - break; - case T_FILE: - tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0); - if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0); - else obj = tmp; - if (NIL_P(obj)) break; - case T_DATA: - if (RDATA(obj)->dmark == enc_mark) { - i = enc_check_encoding(obj); - } - break; + as_default: + default: + case T_STRING: + case T_REGEXP: + i = ENCODING_GET_INLINED(obj); + if (i == ENCODING_INLINE_MAX) { + VALUE iv; + + iv = rb_ivar_get(obj, rb_id_encoding()); + i = NUM2INT(iv); + } + break; + case T_FILE: + tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0); + if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0); + else obj = tmp; + if (NIL_P(obj)) break; + case T_DATA: + if (RDATA(obj)->dmark == enc_mark) { + i = enc_check_encoding(obj); + } + else { + goto as_default; + } + break; } return i; } @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 276 +#define RUBY_PATCHLEVEL 277 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
