Revision: 757 http://trac.macosforge.org/projects/ruby/changeset/757 Author: lsansonetti@apple.com Date: 2008-11-25 17:50:00 -0800 (Tue, 25 Nov 2008) Log Message: ----------- fixing some problems with bytestrings, in the interim the bytestring support is rewritten (patch provided by Vincent Isambart) Modified Paths: -------------- MacRuby/trunk/re.c MacRuby/trunk/string.c Modified: MacRuby/trunk/re.c =================================================================== --- MacRuby/trunk/re.c 2008-11-25 03:13:55 UTC (rev 756) +++ MacRuby/trunk/re.c 2008-11-26 01:50:00 UTC (rev 757) @@ -3196,6 +3196,7 @@ } v = rb_reg_s_quote(Qnil, e); } +#if !WITH_OBJC if (has_ascii_incompat) { if (has_asciionly) { rb_raise(rb_eArgError, "ASCII incompatible encoding: %s", @@ -3206,6 +3207,7 @@ rb_enc_name(has_ascii_incompat), rb_enc_name(has_ascii_compat_fixed)); } } +#endif #if !WITH_OBJC if (i == 0) { Modified: MacRuby/trunk/string.c =================================================================== --- MacRuby/trunk/string.c 2008-11-25 03:13:55 UTC (rev 756) +++ MacRuby/trunk/string.c 2008-11-26 01:50:00 UTC (rev 757) @@ -125,8 +125,8 @@ false, kCFAllocatorNull); if (bytestr != NULL) { + CFStringReplaceAll((CFMutableStringRef)str, (CFStringRef)bytestr); if (CFStringGetLength(bytestr) == datalen) { - CFStringReplaceAll((CFMutableStringRef)str, (CFStringRef)bytestr); rb_str_cfdata_set(str, NULL); } CFRelease(bytestr); @@ -816,6 +816,7 @@ data = (CFMutableDataRef)rb_str_cfdata2(str); if (data != NULL) { CFDataAppendBytes(data, (const UInt8 *)ptr, len); + RSTRING_SYNC(str); } else { long slen; @@ -917,6 +918,7 @@ CFDataGetLength(data)); } } + RSTRING_SYNC(str); return str; }
participants (1)
-
source_changes@macosforge.org