Look for modules in cwd instead of home

gmelquio suggests in bug #2862128 we should use cwd and
not force the home directory where looking for modules
like savefiles. Applied a modified patch which uses glib
and does not leak the string.
This commit is contained in:
riccardom 2009-09-19 17:14:50 +00:00
parent 8b7a7f9b50
commit 47910a5264
1 changed files with 3 additions and 3 deletions

View File

@ -84,9 +84,9 @@ public:
while (p >= pathToModule && *p != '\\') p--;
if (++p >= pathToModule) *p = 0;
#else
// strcpy(pathToModule, g_get_home_dir());
const char *homedir = getenv ("HOME");
strcpy(pathToModule, homedir);
char *cwd = g_get_current_dir();
strncpy(pathToModule, cwd, MAX_PATH);
g_free(cwd);
#endif
}