ruby-changes:12735
From: yugui <ko1@a...>
Date: Sun, 9 Aug 2009 15:04:24 +0900 (JST)
Subject: [ruby-changes:12735] Ruby:r24473 (ruby_1_9_1): merges the latter half of r24423 from trunk into ruby_1_9_1.
yugui 2009-08-09 00:35:16 +0900 (Sun, 09 Aug 2009) New Revision: 24473 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24473 Log: merges the latter half of r24423 from trunk into ruby_1_9_1. * encoding.c (enc_capable, rb_enc_get_index): Symbol is encoding capable. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/encoding.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/encoding.c =================================================================== --- ruby_1_9_1/encoding.c (revision 24472) +++ ruby_1_9_1/encoding.c (revision 24473) @@ -539,7 +539,7 @@ static inline int enc_capable(VALUE obj) { - if (SPECIAL_CONST_P(obj)) return Qfalse; + if (SPECIAL_CONST_P(obj)) return SYMBOL_P(obj); switch (BUILTIN_TYPE(obj)) { case T_STRING: case T_REGEXP: @@ -565,6 +565,10 @@ int i = -1; VALUE tmp; + if (SPECIAL_CONST_P(obj)) { + if (!SYMBOL_P(obj)) return -1; + obj = rb_id2str(SYM2ID(obj)); + } switch (BUILTIN_TYPE(obj)) { as_default: default: Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 24472) +++ ruby_1_9_1/ChangeLog (revision 24473) @@ -1,3 +1,8 @@ +Thu Aug 6 16:25:08 2009 Nobuyoshi Nakada <nobu@r...> + + * encoding.c (enc_capable, rb_enc_get_index): Symbol is encoding + capable. + Wed Aug 5 19:11:01 2009 NARUSE, Yui <naruse@r...> * ruby.c (rb_stdio_set_default_encoding): declared. Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 24472) +++ ruby_1_9_1/version.h (revision 24473) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 277 +#define RUBY_PATCHLEVEL 278 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/