mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-28 04:35:15 +00:00
FS-3232 --resolve using relative path in windows script
This commit is contained in:
parent
8c98328433
commit
5310735c5f
@ -480,9 +480,13 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
|
|||||||
DWORD dwBufSize = BUFSIZE;
|
DWORD dwBufSize = BUFSIZE;
|
||||||
char base_dir[1024];
|
char base_dir[1024];
|
||||||
char *lastbacklash;
|
char *lastbacklash;
|
||||||
|
|
||||||
GetModuleFileName(NULL, base_dir, BUFSIZE);
|
GetModuleFileName(NULL, base_dir, BUFSIZE);
|
||||||
lastbacklash = strrchr(base_dir, '\\');
|
lastbacklash = strrchr(base_dir, '\\');
|
||||||
base_dir[(lastbacklash - base_dir)] = '\0';
|
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
|
#else
|
||||||
char base_dir[1024] = SWITCH_PREFIX_DIR;
|
char base_dir[1024] = SWITCH_PREFIX_DIR;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user