]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
* ALL: New p_vlc->psz_userdir. This is different from psz_homedir in
[vlc] / src / libvlc.c
index 4dd87d5a340f3e881265056df59fe774f16d6c47..66a8d3940a1ed927f094c813b4f6375517dd6db8 100644 (file)
@@ -367,15 +367,16 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     }
 
     /* Set the config file stuff */
+    p_vlc->psz_userdir = config_GetUserDir();
     p_vlc->psz_homedir = config_GetHomeDir();
     p_vlc->psz_configfile = config_GetPsz( p_vlc, "config" );
     if( p_vlc->psz_configfile != NULL && p_vlc->psz_configfile[0] == '~'
          && p_vlc->psz_configfile[1] == '/' )
     {
-        char *psz = malloc( strlen(p_vlc->psz_homedir)
+        char *psz = malloc( strlen(p_vlc->psz_userdir)
                              + strlen(p_vlc->psz_configfile) );
         /* This is incomplete : we should also support the ~cmassiot/ syntax. */
-        sprintf( psz, "%s/%s", p_vlc->psz_homedir,
+        sprintf( psz, "%s/%s", p_vlc->psz_userdir,
                                p_vlc->psz_configfile + 2 );
         free( p_vlc->psz_configfile );
         p_vlc->psz_configfile = psz;