summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-11-26 13:12:45 +0000
committerrubidium <rubidium@openttd.org>2008-11-26 13:12:45 +0000
commita614dd717420b3713f629f8eabe5607c550dedcd (patch)
treec580b06966266044ef5c0a54b557d872556e989d /src/fileio.cpp
parentbb25748a9dfb150b5168af8bffb961335032db6c (diff)
downloadopenttd-a614dd717420b3713f629f8eabe5607c550dedcd.tar.xz
(svn r14636) -Add: DOS port of OpenTTD, without network support though.
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index f7b4a5af2..0e2d4d895 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -773,6 +773,10 @@ void ChangeWorkingDirectory(const char *exe)
char *s = strrchr(exe, PATHSEPCHAR);
if (s != NULL) {
*s = '\0';
+#if defined(__DJGPP__)
+ /* If we want to go to the root, we can't use cd C:, but we must use '/' */
+ if (s[-1] == ':') chdir("/");
+#endif
if (chdir(exe) != 0) DEBUG(misc, 0, "Directory with the binary does not exist?");
*s = PATHSEPCHAR;
}
@@ -788,7 +792,7 @@ void ChangeWorkingDirectory(const char *exe)
void DetermineBasePaths(const char *exe)
{
char tmp[MAX_PATH];
-#if defined(__MORPHOS__) || defined(__AMIGA__) || !defined(WITH_PERSONAL_DIR)
+#if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS) || !defined(WITH_PERSONAL_DIR)
_searchpaths[SP_PERSONAL_DIR] = NULL;
#else
const char *homedir = getenv("HOME");
@@ -826,7 +830,7 @@ void DetermineBasePaths(const char *exe)
AppendPathSeparator(tmp, MAX_PATH);
_searchpaths[SP_BINARY_DIR] = strdup(tmp);
-#if defined(__MORPHOS__) || defined(__AMIGA__)
+#if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS)
_searchpaths[SP_INSTALLATION_DIR] = NULL;
#else
snprintf(tmp, MAX_PATH, "%s", GLOBAL_DATA_DIR);