From f7c33e46e8d98a0b384eadc977a7740619694f04 Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 15 Apr 2007 09:15:56 +0000 Subject: [PATCH] Bugfix for #19588 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25052 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSBundle.m | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fc1e068b..eb1a4fef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-15 Richard Frith-Macdonald + + * Source/NSBundle.m: + ([+pathForResource:ofType:inRootPath:inDirectory:withVersion:]) + Tolerate nil/empty resource name for compatibility with MacOS-X + nad to fix bug #19588 + 2007-04-13 Ricccardo Mottola * Source/NSSortDescriptor.m : removed C99-ism diff --git a/Source/NSBundle.m b/Source/NSBundle.m index f8ccab2e3..30f5ac113 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1595,11 +1595,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) NSString *path, *fullpath; NSEnumerator* pathlist; - if (!name || [name length] == 0) + if (name == nil) { - [NSException raise: NSInvalidArgumentException - format: @"No resource name specified."]; - /* NOT REACHED */ + name = @""; } pathlist = [[self _bundleResourcePathsWithRootPath: rootPath @@ -1627,7 +1625,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) } } else - fullpath = nil; + { + fullpath = nil; + } } else {