Skip to content

Commit

Permalink
Warn if we can't find the library version for a bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 21, 2023
1 parent d9d28b6 commit 270429c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Source/NSBundle.m
Original file line number Diff line number Diff line change
Expand Up @@ -2988,9 +2988,9 @@ + (NSBundle *) bundleForLibrary: (NSString *)libraryName
* change NSUserDefault's manual gnustep-base resource
* lookup to match.
*/
NSArray *paths;
NSEnumerator *enumerator;
NSString *path;
NSArray *paths;
NSEnumerator *enumerator;
NSString *path = libraryName;
NSFileManager *fm = manager();
NSRange r;

Expand Down Expand Up @@ -3079,6 +3079,14 @@ + (NSBundle *) bundleForLibrary: (NSString *)libraryName
}
#endif

if (nil == interfaceVersion
&& NO == [libraryName isEqualToString: @"gnustep-base"])
{
NSLog(@"Warning: [%@+%@] called without version and unable to"
@" infer version from library name (%@).",
NSStringFromClass(self), NSStringFromSelector(_cmd), path);
}

while ([[libraryName pathExtension] length] > 0)
{
libraryName = [libraryName stringByDeletingPathExtension];
Expand Down

0 comments on commit 270429c

Please sign in to comment.