]> git.sesse.net Git - vlc/commitdiff
misc/configuration.c: Use the proper directory separator
authorChristophe Mutricy <xtophe@videolan.org>
Sat, 25 Mar 2006 15:14:38 +0000 (15:14 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sat, 25 Mar 2006 15:14:38 +0000 (15:14 +0000)
src/misc/configuration.c

index ff10a525f4382a0a9d62a9c92492bccf02615b72..60d6de9b4051fd87dccf32e56831eef0ccc80096 100644 (file)
 #include <tchar.h>
 #endif
 
+#if defined( WIN32 ) || defined( UNDER_CE )
+#   define DIR_SEP "\\"
+#else
+#   define DIR_SEP "/"
+#endif
 
 static int ConfigStringToKey( char * );
 static char *ConfigKeyToString( int );
@@ -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) +
                                        strlen(psz_homedir) );
         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 );
     }
     else
@@ -1019,7 +1025,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
                                        strlen(psz_homedir) );
 
         if( psz_filename )
-            sprintf( psz_filename, "%s/" CONFIG_DIR, psz_homedir );
+            sprintf( psz_filename, "%s" DIR_SEP CONFIG_DIR, psz_homedir );
 
         if( !psz_filename )
         {
@@ -1030,7 +1036,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
 
         config_CreateDir( p_this, psz_filename );
 
-        strcat( psz_filename, "/" CONFIG_FILE );
+        strcat( psz_filename, DIR_SEP CONFIG_FILE );
     }
     else
     {