Revision: 138 http://trac.macosforge.org/projects/ruby/changeset/138 Author: lsansonetti@apple.com Date: 2008-04-15 01:50:03 -0700 (Tue, 15 Apr 2008) Log Message: ----------- fixed String#delete Modified Paths: -------------- MacRuby/trunk/string.c Modified: MacRuby/trunk/string.c =================================================================== --- MacRuby/trunk/string.c 2008-04-15 08:19:47 UTC (rev 137) +++ MacRuby/trunk/string.c 2008-04-15 08:50:03 UTC (rev 138) @@ -5110,7 +5110,7 @@ CFCharacterSetRef subset; subset = CFCharacterSetCreateWithCharactersInString(NULL, (CFStringRef)s); - CFCharacterSetUnion((CFMutableCharacterSetRef)charset, subset); + CFCharacterSetIntersect((CFMutableCharacterSetRef)charset, subset); } } @@ -5142,7 +5142,8 @@ CFStringRef str, void *ctx) { CFStringDelete((CFMutableStringRef)str, *result_range); - search_range->length -= search_range->location; + search_range->length -= result_range->length + + (result_range->location - search_range->location); search_range->location = result_range->location; *(bool *)ctx = true; }