mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
fix for bundle loading on wndows when we don't have the dll path extension
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28292 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fbbb625832
commit
26cfabd41c
2 changed files with 23 additions and 2 deletions
|
@ -320,7 +320,7 @@ bundle_object_name(NSString *path, NSString* executable)
|
|||
path = [path stringByAppendingPathComponent: gnustep_target_dir];
|
||||
path1 = [path stringByAppendingPathComponent: name];
|
||||
path = [path stringByAppendingPathComponent: library_combo];
|
||||
path2 = [path stringByAppendingPathComponent: executable];
|
||||
path2 = [path stringByAppendingPathComponent: name];
|
||||
|
||||
if ([mgr isReadableFileAtPath: path2] == YES)
|
||||
return path2;
|
||||
|
@ -328,7 +328,24 @@ bundle_object_name(NSString *path, NSString* executable)
|
|||
return path1;
|
||||
else if ([mgr isReadableFileAtPath: path0] == YES)
|
||||
return path0;
|
||||
return path2;
|
||||
#if defined(__MINGW32__)
|
||||
/* If we couldn't find the binary, and we are on windows, and the name
|
||||
* has no path extension, then let's try looking for a dll.
|
||||
*/
|
||||
if ([name pathExtension] == nil)
|
||||
{
|
||||
if ([mgr isReadableFileAtPath:
|
||||
[path2 stringByAppendingPathExtension: @"dll"]] == YES)
|
||||
return [path2 stringByAppendingPathExtension: @"dll"];
|
||||
else if ([mgr isReadableFileAtPath:
|
||||
[path1 stringByAppendingPathExtension: @"dll"]] == YES)
|
||||
return [path1 stringByAppendingPathExtension: @"dll"];
|
||||
else if ([mgr isReadableFileAtPath:
|
||||
[path0 stringByAppendingPathExtension: @"dll"]] == YES)
|
||||
return [path0 stringByAppendingPathExtension: @"dll"];
|
||||
}
|
||||
#endif
|
||||
return path0;
|
||||
}
|
||||
|
||||
/* Construct a path from components */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue