Changeset - r7575:3866944bd4e8
[Not reviewed]
master
0 1 0
truelight - 17 years ago 2007-09-13 18:50:42
truelight@openttd.org
(svn r11100) -Fix r11099: darn typos...
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -282,57 +282,57 @@ FILE *FioFOpenFileSp(const char *filenam
 

	
 
	if (subdir == NO_DIRECTORY) {
 
		ttd_strlcpy(buf, filename, lengthof(buf));
 
	} else {
 
		snprintf(buf, lengthof(buf), "%s%s%s", _searchpaths[sp], _subdirs[subdir], filename);
 
	}
 

	
 
	f = fopen(buf, mode);
 
#if !defined(WIN32)
 
	if (f == NULL) {
 
		strtolower(buf + strlen(_searchpaths[sp]) - 1);
 
		f = fopen(buf, mode);
 
	}
 
#endif
 
	if (f != NULL && filesize != NULL) {
 
		/* Find the size of the file */
 
		fseek(f, 0, SEEK_END);
 
		*filesize = ftell(f);
 
		fseek(f, 0, SEEK_SET);
 
	}
 
	return f;
 
}
 

	
 
/** Opens OpenTTD files somewhere in a personal or global directory */
 
FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir, size_t *size)
 
FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir, size_t *filesize)
 
{
 
	FILE *f = NULL;
 
	Searchpath sp;
 

	
 
	assert(subdir < NUM_SUBDIRS || subdir == NO_DIRECTORY);
 

	
 
	FOR_ALL_SEARCHPATHS(sp) {
 
		f = FioFOpenFileSp(filename, mode, sp, subdir, size);
 
		f = FioFOpenFileSp(filename, mode, sp, subdir, filesize);
 
		if (f != NULL || subdir == NO_DIRECTORY) break;
 
	}
 

	
 
	return f;
 
}
 

	
 
/**
 
 * Create a directory with the given name
 
 * @param name the new name of the directory
 
 */
 
void FioCreateDirectory(const char *name)
 
{
 
#if defined(WIN32) || defined(WINCE)
 
	CreateDirectory(OTTD2FS(name), NULL);
 
#elif defined(OS2) && !defined(__INNOTEK_LIBC__)
 
	mkdir(OTTD2FS(name));
 
#else
 
	mkdir(OTTD2FS(name), 0755);
 
#endif
 
}
 

	
 
/**
 
 * Appends, if necessary, the path separator character to the end of the string.
 
 * It does not add the path separator to zero-sized strings.
0 comments (0 inline, 0 general)