mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix bug determining path of config file relative to base library
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21832 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9a36fdd337
commit
2e15e7e8e6
1 changed files with 10 additions and 10 deletions
|
@ -372,22 +372,22 @@ GNUstepConfig(void)
|
|||
file = [file stringByStandardizingPath];
|
||||
/*
|
||||
* Special case ... if the config file location begins './'
|
||||
* then we use the directory containing the base library as
|
||||
* the base path.
|
||||
* then we determine it's actual path by working relative
|
||||
* to the gnustep-base library.
|
||||
*/
|
||||
if ([file hasPrefix: @"./"] == YES)
|
||||
{
|
||||
Class c = [NSProcessInfo class];
|
||||
Class c = [NSProcessInfo class];
|
||||
NSString *path = objc_get_symbol_path (c, 0);
|
||||
|
||||
gnustepConfigPath = [path stringByDeletingLastPathComponent];
|
||||
file = [gnustepConfigPath stringByAppendingPathComponent:
|
||||
[file substringFromIndex: 2]];
|
||||
}
|
||||
else
|
||||
{
|
||||
gnustepConfigPath = [file stringByDeletingLastPathComponent];
|
||||
// Remove library name from path
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
// Remove ./ prefix from filename
|
||||
file = [file substringFromIndex: 2];
|
||||
// Join the two together
|
||||
file = [path stringByAppendingPathComponent: file];
|
||||
}
|
||||
gnustepConfigPath = [file stringByDeletingLastPathComponent];
|
||||
RETAIN(gnustepConfigPath);
|
||||
ParseConfigurationFile(file, conf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue