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:
Richard Frith-Macdonald 2005-10-16 15:24:51 +00:00
parent cc49695ba3
commit ba8cea7a10

View file

@ -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);