Skip to content

Commit

Permalink
Fix for 10.8 wonkyness.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccgus committed May 17, 2012
1 parent 4916b19 commit 1a5e3f2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions jscocoa/JSCocoa/BridgeSupportController.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -87,13 +87,26 @@ - (BOOL)loadBridgeSupport:(NSString*)path
// 'st' struct // 'st' struct
if ((c[1] == 'c' && (c[2] == 'o' || c[2] == 'l')) || c[1] == 'e' || (c[1] == 'f' && c[2] == 'u') || (c[1] == 's' && c[2] == 't')) if ((c[1] == 'c' && (c[2] == 'o' || c[2] == 'l')) || c[1] == 'e' || (c[1] == 'f' && c[2] == 'u') || (c[1] == 's' && c[2] == 't'))
{ {
char* tagStart;
char* c0;

tagStart = c;
parsename:
// Extract name // Extract name
char* tagStart = c;
for (; *c && *c != '\''; c++); for (; *c && *c != '\''; c++);
c++; c++;
char* c0 = c; c0 = c;
for (; *c && *c != '\''; c++); for (; *c && *c != '\''; c++);


// 10.8 : 'name' might not be the first attribute in structures. Go back up to find it.
if (*c0 == '{') {
// Skip '
c++;
if (!*c)
return NSLog(@"No name in bridgesupport"), NO;
goto parsename;
}

id name = [[NSString alloc] initWithBytes:c0 length:c-c0 encoding:NSUTF8StringEncoding]; id name = [[NSString alloc] initWithBytes:c0 length:c-c0 encoding:NSUTF8StringEncoding];


// Move to tag end // Move to tag end
Expand Down

0 comments on commit 1a5e3f2

Please sign in to comment.