aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-04-27 21:06:48 +0000
committerLionel Ulmer2002-04-27 21:06:48 +0000
commit8537266a89a8b08d0b5d2d1accb01e0e67cb89d4 (patch)
tree475480172c865fba0306a29335749b794c833fe6 /main.cpp
parent00c03b9a0d06c3cde47941cef3605162fab0205c (diff)
downloadscummvm-rg350-8537266a89a8b08d0b5d2d1accb01e0e67cb89d4.tar.gz
scummvm-rg350-8537266a89a8b08d0b5d2d1accb01e0e67cb89d4.tar.bz2
scummvm-rg350-8537266a89a8b08d0b5d2d1accb01e0e67cb89d4.zip
Applied Triskelios's patch for Unix-style configuration file (ie
.scummvmrc instead of scummvm.ini) svn-id: r4116
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 188545d399..f4916f51c7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,7 +42,16 @@ Config * scummcfg;
#undef main
#endif
+#if defined(UNIX) || defined(UNIX_X11)
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
+#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#else
#define DEFAULT_CONFIG_FILE "scummvm.ini"
+#endif
+
int main(int argc, char *argv[])
{
@@ -79,7 +88,16 @@ int main(int argc, char *argv[])
fclose(argf);
#endif
+
+#if defined(UNIX) || defined(UNIX_X11)
+ char scummhome[MAXPATHLEN];
+ if(getenv("HOME") != NULL)
+ sprintf(scummhome,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE);
+ else strcpy(scummhome,DEFAULT_CONFIG_FILE);
+ scummcfg = new Config(scummhome, "scummvm");
+#else
scummcfg = new Config(DEFAULT_CONFIG_FILE, "scummvm");
+#endif
scummcfg->set("versioninfo", SCUMMVM_VERSION);
if (detector.detectMain(argc, argv))
return (-1);