diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-16 11:43:12 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-16 11:43:12 +0000 |
| commit | ff200fc0f11bafc373f8067f1546ebd2b5894344 (patch) | |
| tree | 4e9589f7ba6772d8cbe0803ebedf11eee530dd7c | |
| parent | dacd6812f3e016e55268b9208eb73d8a768f954f (diff) | |
| download | ruby-ff200fc0f11bafc373f8067f1546ebd2b5894344.tar.gz ruby-ff200fc0f11bafc373f8067f1546ebd2b5894344.tar.xz ruby-ff200fc0f11bafc373f8067f1546ebd2b5894344.zip | |
* encoding.c (rb_enc_compatible): check encoding incapable arguments.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 10 | ||||
| -rw-r--r-- | encoding.c | 3 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Sat Feb 16 18:13:53 2008 Tanaka Akira <akr@fsij.org> + + * encoding.c (rb_enc_compatible): check encoding incapable arguments. + Sat Feb 16 20:12:47 2008 Tanaka Akira <akr@fsij.org> * re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect. @@ -108,7 +112,7 @@ Fri Feb 15 15:23:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Feb 15 10:35:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> - * re.c (rb_reg_quote): set US-ACII for ASCII-only string. + * re.c (rb_reg_quote): set US-ASCII for ASCII-only string. [ruby-dev:33785] Fri Feb 15 10:27:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> @@ -275,7 +279,7 @@ Tue Feb 12 15:27:19 2008 NARUSE, Yui <naruse@ruby-lang.org> * bootstraptest/runner.rb, bootstraptest/test_method.rb, enc/depend, instruby.rb, lib/mkmf.rb, lib/test/unit/util/procwrapper.rb, mkconfig.rb, sample/test.rb, template/vm.inc.tmpl, - test/ruby/test_stringchar.rb: fixes arround String#gsub. + test/ruby/test_stringchar.rb: fixes around String#gsub. Tue Feb 12 15:11:47 2008 NARUSE, Yui <naruse@ruby-lang.org> @@ -290,7 +294,7 @@ Tue Feb 12 15:11:47 2008 NARUSE, Yui <naruse@ruby-lang.org> lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb, lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb, lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb, - lib/yaml/encoding.rb: performance tuning arround String#gsub. + lib/yaml/encoding.rb: performance tuning around String#gsub. Tue Feb 12 12:16:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org> diff --git a/encoding.c b/encoding.c index 335d1ae00..15a068728 100644 --- a/encoding.c +++ b/encoding.c @@ -659,6 +659,9 @@ rb_enc_compatible(VALUE str1, VALUE str2) idx1 = rb_enc_get_index(str1); idx2 = rb_enc_get_index(str2); + if (idx1 < 0 || idx2 < 0) + return 0; + if (idx1 == idx2) { return rb_enc_from_index(idx1); } |
