]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4099 --resolve switch windows to use posix delimiter (/) for base paths. This...
authorJeff Lenk <jeff@jefflenk.com>
Sun, 16 Sep 2012 19:15:49 +0000 (14:15 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Sun, 16 Sep 2012 19:15:49 +0000 (14:15 -0500)
src/include/switch_types.h
src/switch_core.c
src/switch_xml.c

index 088050f86a65c3f5f34b624b1c634287794fa54f..9ddadd1a3ef9ebd1a2f2d2fcdf598373366e6fa2 100644 (file)
@@ -113,7 +113,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_MAX_DTMF_DURATION 192000
 #define SWITCH_DEFAULT_DIR_PERMS SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE
 #ifdef WIN32
-#define SWITCH_PATH_SEPARATOR "\\"
+#define SWITCH_PATH_SEPARATOR "/"
 #else
 #define SWITCH_PATH_SEPARATOR "/"
 #endif
index 3f1a6d507522b1fc28b678c9b1487439ee4e71d6..53bd4b87624a51e6220401e318d31e1a9590c937 100644 (file)
@@ -520,12 +520,16 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
        DWORD dwBufSize = BUFSIZE;
        char base_dir[1024];
        char *lastbacklash;
+       char *tmp;
 
        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);
+       tmp = switch_string_replace(base_dir, "\\", "/");
+       strcpy(base_dir, tmp);
+       free(tmp);
 
 #else
        char base_dir[1024] = SWITCH_PREFIX_DIR;
index 585b8679956b8fca743b3ac607ccbe2a3a07b30e..95a51c39e8214ef9188abebf6ca71a6c8f0b935b 100644 (file)
@@ -3076,7 +3076,7 @@ done:
 #define        RANGE           '-'
 #define        RBRACKET        ']'
 #define        SEP             '/'
-#define WIN_SEP '\\'
+#define WIN_SEP '/'
 #define        STAR            '*'
 #define        TILDE           '~'
 #define        UNDERSCORE      '_'