Projects

Ticket #12: dyld_framework_path.patch

File dyld_framework_path.patch, 0.9 KB (added by maarten@…, 3 years ago)
  • objc.m

     
    29192919    NSString *path; 
    29202920    NSBundle *bundle; 
    29212921    NSError *error; 
    2922  
     2922     
    29232923    rb_scan_args(argc, argv, "11", &framework, &search_network); 
    29242924 
    29252925    Check_Type(framework, T_STRING); 
     
    29772977                stringByAppendingPathComponent:@"Library"]; 
    29782978            FIND_LOAD_PATH_IN_LIBRARY(dir);  
    29792979        } 
     2980         
     2981    dirs = [[[[NSProcessInfo processInfo] environment] valueForKey:@"DYLD_FRAMEWORK_PATH"] componentsSeparatedByString: @":"]; 
     2982    for (i = 0, count = [dirs count]; i < count; i++) { 
     2983        NSString *dir = [dirs objectAtIndex:i]; 
     2984        path = [dir stringByAppendingPathComponent:frameworkName]; 
     2985        if ([fileManager fileExistsAtPath:path]) 
     2986            goto success; 
     2987    } 
    29802988 
    29812989#undef FIND_LOAD_PATH_IN_LIBRARY 
    29822990