src/fileio.cpp
changeset 8120 2ab4ad82fd44
parent 8088 7c1a4dd586ae
child 8121 418ce56ce3a6
equal deleted inserted replaced
8119:9505a65c30d5 8120:2ab4ad82fd44
   293 	if (subdir == NO_DIRECTORY) {
   293 	if (subdir == NO_DIRECTORY) {
   294 		ttd_strlcpy(buf, filename, lengthof(buf));
   294 		ttd_strlcpy(buf, filename, lengthof(buf));
   295 	} else {
   295 	} else {
   296 		snprintf(buf, lengthof(buf), "%s%s%s", _searchpaths[sp], _subdirs[subdir], filename);
   296 		snprintf(buf, lengthof(buf), "%s%s%s", _searchpaths[sp], _subdirs[subdir], filename);
   297 	}
   297 	}
       
   298 
       
   299 #if defined(WIN32)
       
   300 	if (GetFileAttributes(OTTD2FS(buf)) == -1) return NULL;
       
   301 #endif
   298 
   302 
   299 	f = fopen(buf, mode);
   303 	f = fopen(buf, mode);
   300 #if !defined(WIN32)
   304 #if !defined(WIN32)
   301 	if (f == NULL) {
   305 	if (f == NULL) {
   302 		strtolower(buf + strlen(_searchpaths[sp]) - 1);
   306 		strtolower(buf + strlen(_searchpaths[sp]) - 1);