Find library bundles for debug/profile library

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22867 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-05-07 07:49:45 +00:00
parent 42a7dfda6d
commit db4d168095
2 changed files with 23 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2006-05-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundle.m: ignore profile/debug extensions in library name
when looking for library bundles.
2006-05-06 Fred Kiefer <FredKiefer@gmx.de>
* Resources/Languages/Esperanto: New language file.

View file

@ -1039,16 +1039,6 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
{
lib = nil; // In program, not library.
}
lib = [lib lastPathComponent];
do
{
lib = [lib stringByDeletingPathExtension];
}
while ([[lib pathExtension] length] > 0);
if ([lib hasPrefix: @"lib"] == YES)
{
lib = [lib substringFromIndex: 3];
}
/*
* Get the library bundle ... if there wasn't one
@ -2020,12 +2010,30 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
NSString *tail;
NSFileManager *fm = [NSFileManager defaultManager];
/*
* Eliminate any base path or extensions.
*/
libraryName = [libraryName lastPathComponent];
do
{
libraryName = [libraryName stringByDeletingPathExtension];
}
while ([[libraryName pathExtension] length] > 0);
/*
* Discard leading 'lib'
*/
if ([libraryName hasPrefix: @"lib"] == YES)
{
libraryName = [libraryName substringFromIndex: 3];
}
/*
* Discard debug/profile library suffix
*/
if ([libraryName hasSuffix: @"_d"] == YES
|| [libraryName hasSuffix: @"_p"] == YES)
{
libraryName = [libraryName substringToIndex: [libraryName length] - 3];
}
if ([libraryName length] == 0)
{