File diff r23482:de566f8c088d → r23483:3733e6b8ff17
src/fileio.cpp
Show inline comments
 
@@ -1237,33 +1237,24 @@ void DeterminePaths(const char *exe)
 
		FioCreateDirectory(dir);
 
		free(dir);
 
	}
 

	
 
	/* If we have network we make a directory for the autodownloading of content */
 
	_searchpaths[SP_AUTODOWNLOAD_DIR] = str_fmt("%s%s", _personal_dir, "content_download" PATHSEP);
 
#ifdef ENABLE_NETWORK
 
	FioCreateDirectory(_searchpaths[SP_AUTODOWNLOAD_DIR]);
 

	
 
	/* Create the directory for each of the types of content */
 
	const Subdirectory dirs[] = { SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR, GAME_LIBRARY_DIR };
 
	for (uint i = 0; i < lengthof(dirs); i++) {
 
		char *tmp = str_fmt("%s%s", _searchpaths[SP_AUTODOWNLOAD_DIR], _subdirs[dirs[i]]);
 
		FioCreateDirectory(tmp);
 
		free(tmp);
 
	}
 

	
 
	extern char *_log_file;
 
	_log_file = str_fmt("%sopenttd.log",  _personal_dir);
 
#else /* ENABLE_NETWORK */
 
	/* If we don't have networking, we don't need to make the directory. But
 
	 * if it exists we keep it, otherwise remove it from the search paths. */
 
	if (!FileExists(_searchpaths[SP_AUTODOWNLOAD_DIR]))  {
 
		free(_searchpaths[SP_AUTODOWNLOAD_DIR]);
 
		_searchpaths[SP_AUTODOWNLOAD_DIR] = NULL;
 
	}
 
#endif /* ENABLE_NETWORK */
 
}
 

	
 
/**
 
 * Sanitizes a filename, i.e. removes all illegal characters from it.
 
 * @param filename the "\0" terminated filename
 
 */