[macruby-changes] [167] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Wed Apr 23 18:21:56 PDT 2008
Revision: 167
http://trac.macosforge.org/projects/ruby/changeset/167
Author: lsansonetti at apple.com
Date: 2008-04-23 18:21:55 -0700 (Wed, 23 Apr 2008)
Log Message:
-----------
misc fixed
Modified Paths:
--------------
MacRuby/trunk/encoding.c
MacRuby/trunk/string.c
Modified: MacRuby/trunk/encoding.c
===================================================================
--- MacRuby/trunk/encoding.c 2008-04-23 22:54:02 UTC (rev 166)
+++ MacRuby/trunk/encoding.c 2008-04-24 01:21:55 UTC (rev 167)
@@ -758,7 +758,11 @@
int
rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
{
+#if WITH_OBJC
+ int n = 1;
+#else
int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
+#endif
if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= e-p)
return MBCLEN_CHARFOUND_LEN(n);
else {
Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c 2008-04-23 22:54:02 UTC (rev 166)
+++ MacRuby/trunk/string.c 2008-04-24 01:21:55 UTC (rev 167)
@@ -6206,10 +6206,14 @@
#define YIELD_SUBSTR(range) \
do { \
+ VALUE mcopy; \
substr = CFStringCreateWithSubstring(NULL, (CFStringRef)str, \
range); \
- CFMakeCollectable((CFTypeRef)substr); \
- rb_yield((VALUE)substr); \
+ mcopy = (VALUE)CFStringCreateMutableCopy(NULL, 0, \
+ (CFStringRef)substr); \
+ CFMakeCollectable((CFTypeRef)mcopy); \
+ rb_yield(mcopy); \
+ CFRelease(substr); \
} \
while (0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080423/1f6c1b73/attachment.html
More information about the macruby-changes
mailing list