diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-02 17:36:03 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-02 17:36:03 +0000 |
commit | 0608b15caa35831a16aa7e5fd1490df24dd01784 (patch) | |
tree | d36c1f14713752cc077b6afe320c0e9123618293 /Foundation/GTMRegex.m | |
parent | a470905a1dffcc61761dc49be13c2d1c8761d0d1 (diff) |
[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)
Diffstat (limited to 'Foundation/GTMRegex.m')
-rw-r--r-- | Foundation/GTMRegex.m | 15 |
1 files changed, 8 insertions, 7 deletions
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:@" ) }"]; |