]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
Replaced all calls to str[n]cat and strncpy by calls to strlcat and strlcpy respectively
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index bf4c3c6d52d2c242cf9109b60047c6df04eaee78..3aab0537b24f27f7cb3d4ed84befff07453de7d0 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1,7 +1,7 @@
 /*
        DarkPlaces file system
 
-       Copyright (C) 2003-2005 Mathieu Olivier
+       Copyright (C) 2003-2006 Mathieu Olivier
 
        This program is free software; you can redistribute it and/or
        modify it under the terms of the GNU General Public License
@@ -1061,9 +1061,14 @@ void FS_Init (void)
 
        fs_mempool = Mem_AllocPool("file management", 0, NULL);
 
-       strcpy(fs_basedir, "");
        strcpy(fs_gamedir, "");
 
+// If the base directory is explicitly defined by the compilation process
+#ifdef DP_FS_BASEDIR
+       strcpy(fs_basedir, DP_FS_BASEDIR);
+#else
+       strcpy(fs_basedir, "");
+
 #ifdef MACOSX
        // FIXME: is there a better way to find the directory outside the .app?
        if (strstr(com_argv[0], ".app/"))
@@ -1076,6 +1081,7 @@ void FS_Init (void)
                strlcpy(fs_basedir, com_argv[0], sizeof(fs_basedir));
                fs_basedir[split - com_argv[0]] = 0;
        }
+#endif
 #endif
 
        PK3_OpenLibrary ();