]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3232 --resolve using relative path in windows script
authorJeff Lenk <jeff@jefflenk.com>
Thu, 7 Apr 2011 20:47:30 +0000 (15:47 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Thu, 7 Apr 2011 20:47:30 +0000 (15:47 -0500)
src/switch_core.c

index 85e795c408f0823e7df2f646023fb73650647cb4..0ee4708a3d7a2592fc8d0182c8588e48a766da8a 100644 (file)
@@ -480,9 +480,13 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
        DWORD dwBufSize = BUFSIZE;
        char base_dir[1024];
        char *lastbacklash;
+
        GetModuleFileName(NULL, base_dir, BUFSIZE);
        lastbacklash = strrchr(base_dir, '\\');
        base_dir[(lastbacklash - base_dir)] = '\0';
+       /* set base_dir as cwd, to be able to use relative paths in scripting languages (e.g. mod_lua) when FS is running as a service or while debugging FS using visual studio */
+       SetCurrentDirectory(base_dir);
+
 #else
        char base_dir[1024] = SWITCH_PREFIX_DIR;
 #endif