From: giwoong.kim Date: Wed, 26 Dec 2012 12:26:11 +0000 (+0900) Subject: args: call GetModuleFileName on Windows X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7be8e903488ec7844583fd7d9d03b9166fa919e1;p=sdk%2Femulator%2Fqemu.git args: call GetModuleFileName on Windows Retrieves the fully qualified path for the file that contains the module. Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 1ec568a4f0..d12e75d762 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -310,6 +310,21 @@ static void parse_options(int argc, char *argv[], int *skin_argc, static void get_bin_dir(char *exec_argv) { + char *p = NULL; + +#ifdef CONFIG_WIN32 + TCHAR szEXEPath[1024] = { 0, }; + GetModuleFileName(NULL, szEXEPath, 1024); + + p = strrchr(szEXEPath, '\\'); + // TODO : null + + strncpy(bin_dir, szEXEPath, strlen(szEXEPath) - strlen(p)); + + strcat(bin_dir, "\\"); + return; +#endif + if (!exec_argv) { return; } @@ -320,29 +335,16 @@ static void get_bin_dir(char *exec_argv) return; } - char *p = NULL; -#ifdef _WIN32 - p = strrchr(data, '\\'); - if (!p) { - p = strrchr(data, '/'); - } -#else p = strrchr(data, '/'); -#endif if (!p) { free(data); return; } strncpy(bin_dir, data, strlen(data) - strlen(p)); -#ifdef _WIN32 - strcat(bin_dir, "\\"); -#else - strcat(bin_dir, "/"); -#endif + strcat(bin_dir, "/"); free(data); - } char* get_bin_path(void) {