diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-02 22:12:08 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-02 22:12:08 +0000 |
commit | bb2a8884e394094da40f82886eacb21c1f798eaf (patch) | |
tree | 043be5d7465101828aa626170fe8712de4e64fa9 /src/main.cpp | |
parent | 88b41d7c9ffe40248218a7af58d92910c6737679 (diff) | |
download | mana-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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
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)) { |