From d66abe4b016a12bcc257a65ae4132dfa9cc96f3d Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 6 Jun 2000 22:12:39 +0000 Subject: [PATCH] Fix name search so full path is returned git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6643 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/base/UdpPort.h | 4 +++- Source/NSBundle.m | 6 +++--- Source/NSTimeZone.m | 6 +++--- Source/UdpPort.m | 2 +- Testing/nstimezone.m | 11 +++++++---- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Headers/gnustep/base/UdpPort.h b/Headers/gnustep/base/UdpPort.h index 605d19acc..430068ff4 100644 --- a/Headers/gnustep/base/UdpPort.h +++ b/Headers/gnustep/base/UdpPort.h @@ -27,7 +27,9 @@ #include #include #include -#ifndef __WIN32__ +#ifdef __WIN32__ +# include +#else # include # include #endif /* !WIN32 */ diff --git a/Source/NSBundle.m b/Source/NSBundle.m index b5b5e60b9..8b5fd7c8f 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -192,8 +192,8 @@ _bundle_name_first_match(NSString* directory, NSString* name) filelist = [[mgr directoryContentsAtPath: directory] objectEnumerator]; while ((match = [filelist nextObject])) { - if ([path isEqual: [match stringByDeletingPathExtension]]) - return match; + if ([name isEqual: [match stringByDeletingPathExtension]]) + return [directory stringByAppendingPathComponent: match]; } return nil; @@ -768,7 +768,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) while ((match = [filelist nextObject])) { if (allfiles || [extension isEqual: [match pathExtension]]) - [resources addObject: match]; + [resources addObject: [path stringByAppendingPathComponent: match]]; } } diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index 9c56df8c6..ebd9ea8f9 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -994,10 +994,10 @@ static NSMapTable *absolutes = 0; + (NSString*) getTimeZoneFile: (NSString *)name { - NSString *fileName = [NSString stringWithFormat: @"%@%@", ZONES_DIR, name]; - NSString *path = [NSBundle pathForGNUstepResource: fileName + NSString *dir = [NSString stringWithFormat: @"%@/%@", TIME_ZONE_DIR, ZONES_DIR]; + NSString *path = [NSBundle pathForGNUstepResource: name ofType: @"" - inDirectory: TIME_ZONE_DIR]; + inDirectory: dir]; return path; } diff --git a/Source/UdpPort.m b/Source/UdpPort.m index 0dff574c4..b38fe4dde 100644 --- a/Source/UdpPort.m +++ b/Source/UdpPort.m @@ -31,7 +31,6 @@ #include #include #include -#include #if _AIX #include @@ -40,6 +39,7 @@ #ifdef __WIN32__ #include #else +#include #include #include #include diff --git a/Testing/nstimezone.m b/Testing/nstimezone.m index b18543f7b..5875b2abf 100644 --- a/Testing/nstimezone.m +++ b/Testing/nstimezone.m @@ -4,15 +4,18 @@ #include #include #include +#include int main () { - id detail; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; - printf("time zones for PST:\n%@\n", + NSLog(@"time zones:\n%@\n", [[NSTimeZone timeZoneArray] description]); + NSLog(@"time zones for PST:\n%@\n", [[[NSTimeZone abbreviationMap] objectForKey: @"PST"] description]); - printf("time zones:\n%@\n", [[NSTimeZone timeZoneArray] description]); - printf("local time zone:\n%@\n", [[NSTimeZone localTimeZone] description]); + NSLog(@"local time zone:\n%@\n", [[NSTimeZone localTimeZone] description]); + + [pool release]; return 0; }