[macruby-changes] [3804] MacRuby/trunk/string.c
source_changes at macosforge.org
source_changes at macosforge.org
Thu Mar 18 01:01:17 PDT 2010
Revision: 3804
http://trac.macosforge.org/projects/ruby/changeset/3804
Author: lsansonetti at apple.com
Date: 2010-03-18 01:01:14 -0700 (Thu, 18 Mar 2010)
Log Message:
-----------
fixed bugs in Encoding.compatible?
Modified Paths:
--------------
MacRuby/trunk/string.c
Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c 2010-03-18 05:58:20 UTC (rev 3803)
+++ MacRuby/trunk/string.c 2010-03-18 08:01:14 UTC (rev 3804)
@@ -1245,18 +1245,12 @@
VALUE
mr_enc_s_is_compatible(VALUE klass, SEL sel, VALUE str1, VALUE str2)
{
- if (SPECIAL_CONST_P(str1) || SPECIAL_CONST_P(str2)) {
- return Qnil;
- }
- assert(IS_RSTR(str1)); // TODO
- assert(IS_RSTR(str2)); // TODO
- rb_encoding_t *encoding = str_compatible_encoding(RSTR(str1), RSTR(str2));
+ rb_encoding_t *encoding = str_compatible_encoding(RSTR(str1),
+ str_need_string(str2));
if (encoding == NULL) {
return Qnil;
}
- else {
- return (VALUE)encoding;
- }
+ return (VALUE)encoding;
}
static VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100318/350ac4e8/attachment.html>
More information about the macruby-changes
mailing list