]> git.sesse.net Git - vlc/commitdiff
* src/libvlc.c: When the user dir is not available, fall back onto the
authorChristophe Massiot <massiot@videolan.org>
Mon, 5 Sep 2005 23:33:14 +0000 (23:33 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 5 Sep 2005 23:33:14 +0000 (23:33 +0000)
   application data directory.

src/libvlc.c

index df0ae2e2c2b3b47853be6ffdef9999b23666d309..4534338ce7711a686416f22d127818464382e137 100644 (file)
@@ -367,8 +367,10 @@ 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_userdir = config_GetUserDir();
+    if( p_vlc->psz_userdir == NULL )
+        p_vlc->psz_userdir = strdup(p_vlc->psz_homedir);
     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] == '/' )