summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:35:29 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:35:29 +0000
commit18474514cf2c3d1fcf0e6993bd94c226fcd149c7 (patch)
treefac255f8ec7aab86f5ddc690bb6206ed43f8ca77
parentd3554dba41442ecad7bb8387ad35c72e7f09710b (diff)
merges r24425 from trunk into ruby_1_9_1.
-- * encoding.c (rb_enc_associate_index): cannot set encoding on special constants. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--encoding.c3
-rw-r--r--version.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 96135b8cf..d6f69a84f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ Thu Aug 6 16:25:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (enc_capable, rb_enc_get_index): Symbol is encoding
capable.
+ * encoding.c (rb_enc_associate_index): cannot set encoding on
+ special constants.
+
Wed Aug 5 19:11:01 2009 NARUSE, Yui <naruse@ruby-lang.org>
* ruby.c (rb_stdio_set_default_encoding): declared.
diff --git a/encoding.c b/encoding.c
index faebdfac8..bc960c26a 100644
--- a/encoding.c
+++ b/encoding.c
@@ -617,6 +617,9 @@ rb_enc_associate_index(VALUE obj, int idx)
/* enc_check_capable(obj);*/
if (rb_enc_get_index(obj) == idx)
return obj;
+ if (SPECIAL_CONST_P(obj)) {
+ rb_raise(rb_eArgError, "cannot set encoding");
+ }
if (!ENC_CODERANGE_ASCIIONLY(obj) ||
!rb_enc_asciicompat(rb_enc_from_index(idx))) {
ENC_CODERANGE_CLEAR(obj);
diff --git a/version.h b/version.h
index 7d70338c6..2fa35f511 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 278
+#define RUBY_PATCHLEVEL 279
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1