Permalink
Browse files

Fix capture name retrieval for multi-character names.

  • Loading branch information...
1 parent e394a1e commit b2f7dafaac6f5c56d733dded47094a04ddf504d7 @shadowphoenix shadowphoenix committed May 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 framework/core/OnigRegexp.m
@@ -280,7 +280,7 @@ - (NSMutableArray*) captureNameArray {
int co_name_callback(const OnigUChar* name, const OnigUChar* end, int ngroups, int* group_list, OnigRegex re, void* arg) {
OnigResult *result = (OnigResult *)arg;
- [[result captureNameArray] addObject:[NSString stringWithUTF8String:(const char*)name]];
+ [[result captureNameArray] addObject:[NSString stringWithCharacters:(unichar*)name length:((end-name)/CHAR_SIZE)]];
return 0;
}

0 comments on commit b2f7daf

Please sign in to comment.