mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Update pathc check
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f7fd716136
commit
d9201252dc
3 changed files with 21 additions and 11 deletions
|
@ -279,17 +279,20 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
|||
mutableCopy]);
|
||||
[system appendString: @"/Libraries"];
|
||||
|
||||
_executable_path = nil;
|
||||
#ifdef HAVE_PROC_FS_EXE_LINK
|
||||
_executable_path = [[NSFileManager defaultManager]
|
||||
pathContentOfSymbolicLinkAtPath: @"/proc/self/exe"];
|
||||
#else
|
||||
_executable_path =
|
||||
[[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
||||
output = objc_find_executable([_executable_path cString]);
|
||||
NSAssert(output, NSInternalInconsistencyException);
|
||||
_executable_path = [NSString stringWithCString: output];
|
||||
OBJC_FREE(output);
|
||||
#endif
|
||||
if (_executable_path == nil || [_executable_path length] == 0)
|
||||
{
|
||||
_executable_path =
|
||||
[[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
||||
output = objc_find_executable([_executable_path cString]);
|
||||
NSAssert(output, NSInternalInconsistencyException);
|
||||
_executable_path = [NSString stringWithCString: output];
|
||||
OBJC_FREE(output);
|
||||
}
|
||||
|
||||
RETAIN(_executable_path);
|
||||
_gnustep_bundle = RETAIN([NSBundle bundleWithPath: system]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue