diff --git a/Source/NSBundle.m b/Source/NSBundle.m index b2c38aa64..2240f59ad 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1,5 +1,5 @@ /* Implementation of NSBundle class - Copyright (C) 1993,1994,1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993,1994,1995, 1996, 1997 Free Software Foundation, Inc. Written by: Adam Fedor Date: May 1993 @@ -22,15 +22,6 @@ */ -#include - -#ifndef __WIN32__ -#include -#include /* Needed by sys/stat */ -#endif - -#include -#include #include #include #include @@ -45,6 +36,14 @@ #include #include +#include +#include + +#ifndef __WIN32__ +#include +#include /* Needed by sys/stat */ +#endif + /* Deal with strchr: */ #if STDC_HEADERS || HAVE_STRING_H #include @@ -62,6 +61,7 @@ /* memory.h and strings.h conflict on some systems. */ #endif /* not STDC_HEADERS and not HAVE_STRING_H */ +/* For DIR and diropen() */ #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) @@ -166,7 +166,7 @@ _bundle_path_for_name(NSString* path, NSString* name) { while ((entry = readdir(thedir))) { - if (*entry->d_name != '.' + if (*(entry->d_name) != '.' && strncmp([name cString], entry->d_name, [name length]) == 0) { fullname = [NSString stringWithCString: entry->d_name];