summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-02 22:12:08 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-02 22:12:08 +0000
commitbb2a8884e394094da40f82886eacb21c1f798eaf (patch)
tree043be5d7465101828aa626170fe8712de4e64fa9
parent88b41d7c9ffe40248218a7af58d92910c6737679 (diff)
downloadMana-bb2a8884e394094da40f82886eacb21c1f798eaf.tar.gz
Mana-bb2a8884e394094da40f82886eacb21c1f798eaf.tar.bz2
Mana-bb2a8884e394094da40f82886eacb21c1f798eaf.tar.xz
Mana-bb2a8884e394094da40f82886eacb21c1f798eaf.zip
Use PhysFS to determine user's home directory on unix. Removed an now unused header.
-rw-r--r--ChangeLog5
-rw-r--r--src/main.cpp15
2 files changed, 6 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index f45feaa8..14a83841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-03 Björn Steinbrink <B.Steinbrink@gmx.de>
+
+ * src/main.cpp: Use PhysFS to determine user's home directory on unix
+ system. Removed an now unused header.
+
2005-08-02 Andrej Sinicyn <andrej4000@gmail.com>
* src/game.cpp: Fixed "Trade canceled" happening often.
diff --git a/src/main.cpp b/src/main.cpp
index c2ea4886..8e068601 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -46,9 +46,6 @@
#include <curl/curl.h>
#include <SDL.h>
#include <SDL_thread.h>
-#ifdef USE_OPENGL
-#include <SDL_opengl.h>
-#endif
#include <SDL_image.h>
#ifdef __USE_UNIX98
@@ -140,19 +137,9 @@ void init_engine()
// In Windows and other systems we currently store data next to executable.
homeDir = ".";
#else
- // But, in UNIX we store data in ~/.tmw/
- passwd *pass = getpwuid(geteuid());
-
- if (pass == NULL || pass->pw_dir == NULL) {
- std::cout << "Couldn't determine the user home directory. Exitting." << std::endl;
- exit(1);
- }
+ homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
// Checking if /home/user/.tmw folder exists.
-
- homeDir = pass->pw_dir;
- homeDir += "/.tmw";
- //sprintf(homeDir, "%s/.tmw", pass->pw_dir);
if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
(errno != EEXIST))
{