From 379686e212726a11ca83b59ef85ceb9a704f7956 Mon Sep 17 00:00:00 2001 From: fedor Date: Thu, 11 May 2000 04:03:51 +0000 Subject: [PATCH] gnustep_bundle fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6591 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSBundle.m | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5ff5c279..ccbc66cf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-05-10 Adam Fedor + + * NSBundle.m (-classNamed:): Hacks for getting classes from + _gnustep_bundle. + (-principalClass): Likewise. + (-load): Don't try to call load bundle if we are _gnustep_bundle. + 2000-05-09 Richard Frith-Macdonald * Source/NSDistantObject.m: ([-methodSignatureForSelector:]) diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 186089c09..ab376b076 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -521,7 +521,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) } } - if (self == _mainBundle) + if (self == _mainBundle || self == _gnustep_bundle) { theClass = NSClassFromString(className); if (theClass && [[self class] bundleForClass:theClass] != _mainBundle) @@ -546,7 +546,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) class_name = [[self infoDictionary] objectForKey: @"NSPrincipalClass"]; - if (self == _mainBundle) + if (self == _mainBundle || self == _gnustep_bundle) { _codeLoaded = YES; if (class_name) @@ -566,11 +566,22 @@ _bundle_load_callback(Class theClass, Category *theCategory) - (BOOL) load { + if (self == _mainBundle || self == _gnustep_bundle) + { + _codeLoaded = YES; + return YES; + } + [load_lock lock]; if (!_codeLoaded) { NSString* object; object = [[self infoDictionary] objectForKey: @"NSExecutable"]; + if (object == nil || [object length] == 0) + { + [load_lock unlock]; + return NO; + } object = bundle_object_name(_path, object); _loadingBundle = self; _bundleClasses = RETAIN([NSMutableArray arrayWithCapacity: 2]);