Skip to content
Browse files

Fix for 10.8 wonkyness.

  • Loading branch information...
1 parent 4916b19 commit 1a5e3f2e8a7fe53acb5a9b02c15ef470851a2512 @ccgus committed
Showing with 15 additions and 2 deletions.
  1. +15 −2 jscocoa/JSCocoa/BridgeSupportController.m
View
17 jscocoa/JSCocoa/BridgeSupportController.m
@@ -87,13 +87,26 @@ - (BOOL)loadBridgeSupport:(NSString*)path
// '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'))
{
+ char* tagStart;
+ char* c0;
+
+ tagStart = c;
+parsename:
// Extract name
- char* tagStart = c;
for (; *c && *c != '\''; c++);
c++;
- char* c0 = c;
+ c0 = 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];
// Move to tag end

0 comments on commit 1a5e3f2

Please sign in to comment.
Something went wrong with that request. Please try again.