Changeset - r13169:c632333b66d8
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-10-03 14:51:30
rubidium@openttd.org
(svn r17686) -Fix [FS#3247]: make the -c <config file> location relative to the current directory instead of the directory of the binary
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -871,12 +871,17 @@ void DetermineBasePaths(const char *exe)
 
	/* Change the working directory to that one of the executable */
 
	ChangeWorkingDirectory(exe);
 
	if (getcwd(tmp, MAX_PATH) == NULL) *tmp = '\0';
 
	AppendPathSeparator(tmp, MAX_PATH);
 
	_searchpaths[SP_BINARY_DIR] = strdup(tmp);
 

	
 
	if (_searchpaths[SP_WORKING_DIR] != NULL) {
 
		/* Go back to the current working directory. */
 
		ChangeWorkingDirectory(_searchpaths[SP_WORKING_DIR]);
 
	}
 

	
 
#if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS) || defined(OS2)
 
	_searchpaths[SP_INSTALLATION_DIR] = NULL;
 
#else
 
	snprintf(tmp, MAX_PATH, "%s", GLOBAL_DATA_DIR);
 
	AppendPathSeparator(tmp, MAX_PATH);
 
	_searchpaths[SP_INSTALLATION_DIR] = strdup(tmp);
0 comments (0 inline, 0 general)