Commit e4afdce0 authored by Christophe Mutricy's avatar Christophe Mutricy

misc/configuration.c: Use the proper directory separator

parent c1d72229
...@@ -63,6 +63,11 @@ ...@@ -63,6 +63,11 @@
#include <tchar.h> #include <tchar.h>
#endif #endif
#if defined( WIN32 ) || defined( UNDER_CE )
# define DIR_SEP "\\"
#else
# define DIR_SEP "/"
#endif
static int ConfigStringToKey( char * ); static int ConfigStringToKey( char * );
static char *ConfigKeyToString( int ); static char *ConfigKeyToString( int );
...@@ -775,7 +780,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -775,7 +780,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
psz_filename = (char *)malloc( sizeof("/" CONFIG_DIR "/" CONFIG_FILE) + psz_filename = (char *)malloc( sizeof("/" CONFIG_DIR "/" CONFIG_FILE) +
strlen(psz_homedir) ); strlen(psz_homedir) );
if( psz_filename ) if( psz_filename )
sprintf( psz_filename, "%s/" CONFIG_DIR "/" CONFIG_FILE, sprintf( psz_filename,
"%s" DIR_SEP CONFIG_DIR DIR_SEP CONFIG_FILE,
psz_homedir ); psz_homedir );
} }
else else
...@@ -1019,7 +1025,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, ...@@ -1019,7 +1025,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
strlen(psz_homedir) ); strlen(psz_homedir) );
if( psz_filename ) if( psz_filename )
sprintf( psz_filename, "%s/" CONFIG_DIR, psz_homedir ); sprintf( psz_filename, "%s" DIR_SEP CONFIG_DIR, psz_homedir );
if( !psz_filename ) if( !psz_filename )
{ {
...@@ -1030,7 +1036,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, ...@@ -1030,7 +1036,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
config_CreateDir( p_this, psz_filename ); config_CreateDir( p_this, psz_filename );
strcat( psz_filename, "/" CONFIG_FILE ); strcat( psz_filename, DIR_SEP CONFIG_FILE );
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment