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
This commit is contained in:
Adam Fedor 2000-06-06 22:12:39 +00:00
parent 9de41b06f6
commit 420a803031
5 changed files with 17 additions and 12 deletions

View file

@ -27,7 +27,9 @@
#include <base/preface.h>
#include <base/Port.h>
#include <sys/types.h>
#ifndef __WIN32__
#ifdef __WIN32__
# include <winsock.h>
#else
# include <sys/socket.h>
# include <netinet/in.h>
#endif /* !WIN32 */

View file

@ -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]];
}
}

View file

@ -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;
}

View file

@ -31,7 +31,6 @@
#include <Foundation/NSLock.h>
#include <Foundation/NSException.h>
#include <Foundation/NSHost.h>
#include <unistd.h>
#if _AIX
#include <sys/select.h>
@ -40,6 +39,7 @@
#ifdef __WIN32__
#include <winsock.h>
#else
#include <unistd.h>
#include <netdb.h>
#include <time.h>
#include <sys/time.h>

View file

@ -4,15 +4,18 @@
#include <Foundation/NSArray.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSAutoreleasePool.h>
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;
}