Revision: 3736 http://trac.macosforge.org/projects/ruby/changeset/3736 Author: lsansonetti@apple.com Date: 2010-03-11 14:00:38 -0800 (Thu, 11 Mar 2010) Log Message: ----------- some cleanup Modified Paths: -------------- MacRuby/branches/icu/re.cpp Modified: MacRuby/branches/icu/re.cpp =================================================================== --- MacRuby/branches/icu/re.cpp 2010-03-11 22:00:26 UTC (rev 3735) +++ MacRuby/branches/icu/re.cpp 2010-03-11 22:00:38 UTC (rev 3736) @@ -99,7 +99,7 @@ rb_str_get_uchars(str, &chars, &chars_len, &need_free); - UnicodeString *unistr = new UnicodeString((const UChar *)chars, chars_len); + UnicodeString *unistr = new UnicodeString(false, (const UChar *)chars, chars_len); if (need_free) { free(chars); @@ -132,9 +132,8 @@ sanitize_regexp_string(unistr); - UParseError pe; UErrorCode status = U_ZERO_ERROR; - RegexPattern *pattern = RegexPattern::compile(*unistr, option, pe, status); + RegexPattern *pattern = RegexPattern::compile(*unistr, option, status); if (pattern == NULL) { delete unistr; @@ -150,7 +149,6 @@ regexp_finalize(regexp); regexp->pattern = pattern; regexp->unistr = unistr; - return true; } @@ -563,11 +561,11 @@ if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) { // Creating a new Match object. match = (VALUE)match_alloc(rb_cMatch, 0); - rb_backref_set(match); res = (rb_match_result_t *)xmalloc(sizeof(rb_match_result_t) * res_count); GC_WB(&RMATCH(match)->results, res); GC_WB(&RMATCH(match)->str, rb_str_new(NULL, 0)); + rb_backref_set(match); } else { // Reusing the previous Match object.