From 0608b15caa35831a16aa7e5fd1490df24dd01784 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 2 Jun 2010 17:36:03 +0000 Subject: [Author: dmaclach] Cleans up builds of GTM on Snow Leopard with gcc 4.2. Cleans up iPhone configs Adds libgcov for Snow Leopard Fixes up some small bugs. R=thomasvl DELTA=2028 (972 added, 990 deleted, 66 changed) --- Foundation/GTMRegex.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Foundation/GTMRegex.m') diff --git a/Foundation/GTMRegex.m b/Foundation/GTMRegex.m index 4c393a6..f4d6362 100644 --- a/Foundation/GTMRegex.m +++ b/Foundation/GTMRegex.m @@ -719,13 +719,14 @@ static NSString *const kReplacementPattern = [NSMutableString stringWithFormat:@"%@<%p> { isMatch=\"%s\", subPatterns=(", [self class], self, (isMatch_ ? "YES" : "NO")]; for (NSUInteger x = 0; x <= numRegMatches_; ++x) { - NSString *format = @", \"%.*s\""; - if (x == 0) - format = @" \"%.*s\""; - - [result appendFormat:format, - (int)(regMatches_[x].rm_eo - regMatches_[x].rm_so), - (((const char*)[utf8StrBuf_ bytes]) + regMatches_[x].rm_so)]; + NSInteger length = (NSInteger)(regMatches_[x].rm_eo - regMatches_[x].rm_so); + const char* string + = (((const char*)[utf8StrBuf_ bytes]) + regMatches_[x].rm_so); + if (x == 0) { + [result appendFormat:@" \"%.*s\"", length , string]; + } else { + [result appendFormat:@", \"%.*s\"", length , string]; + } } [result appendString:@" ) }"]; -- cgit v1.2.3