From 47910a5264e4ab8d782a32d3259de31fa3fe3777 Mon Sep 17 00:00:00 2001 From: riccardom Date: Sat, 19 Sep 2009 17:14:50 +0000 Subject: [PATCH] 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. --- desmume/src/path.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desmume/src/path.h b/desmume/src/path.h index 785165401..607e21163 100644 --- a/desmume/src/path.h +++ b/desmume/src/path.h @@ -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 }