In cf_find_file_location, it was looking for the existence of a file in every subdir with a call to fopen()...I changed that to _findfirst().
for (i=CF_TYPE_ROOT; i {
if ( i != pathtype ) {
search_order[num_search_dirs++] = i;
}
}
#if defined WIN32
long findhandle;
_finddata_t findstruct;
#endif
for (i=0; i {
char longname[MAX_PATH_LEN];
cf_create_default_path_string( longname, search_order[i], filespec, localize );
#if defined _WIN32
findhandle = _findfirst(longname, &findstruct);
if (findhandle != -1) {
if ( size ) {
*size = findstruct.size;
}
_findclose(findhandle);
#elif defined unix
FILE *fp = fopen(longname, "rb" );
if (fp) {
if ( size ) {
struct stat statbuf;
fstat(fileno(fp), &statbuf);
*size = statbuf.st_size;
}
fclose(fp);
#endif
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, longname );
}
return 1;
}
}