Commit 0038469d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use config_GetUserConfDir internally too

parent 75c438d3
......@@ -92,7 +92,7 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
"version 0.6. Your\nconfiguration has been "
"copied to the new location:\n%s\nYou can "
"delete this directory and all its contents.",
libvlc_priv(p_obj->p_libvlc)->psz_configdir);
psz_filename);
fclose( p_readme );
}
free( psz_readme );
......@@ -401,8 +401,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
if( libvlc_priv (p_this->p_libvlc)->psz_configfile == NULL )
{
const char *psz_configdir =
libvlc_priv(p_this->p_libvlc)->psz_configdir;
char *psz_configdir = config_GetUserConfDir();
if( !psz_configdir ) /* XXX: This should never happen */
{
msg_Err( p_this, "no configuration directory defined" );
......@@ -411,6 +410,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
}
config_CreateDir( p_this, psz_configdir );
free( psz_configdir );
}
file = config_OpenConfigFile( p_this, "rt" );
......@@ -670,10 +670,12 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
*/
char *config_GetConfigFile( libvlc_int_t *p_libvlc )
{
char *psz_dir = config_GetUserConfDir();
char *psz_configfile;
if( asprintf( &psz_configfile, "%s" DIR_SEP CONFIG_FILE,
libvlc_priv (p_libvlc)->psz_configdir ) == -1 )
return NULL;
if( asprintf( &psz_configfile, "%s" DIR_SEP CONFIG_FILE, psz_dir ) == -1 )
psz_configfile = NULL;
free( psz_dir );
return psz_configfile;
}
......
......@@ -296,7 +296,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Set the config file stuff */
p_libvlc->psz_homedir = config_GetHomeDir();
priv->psz_configdir = config_GetUserConfDir();
priv->psz_datadir = config_GetUserDataDir();
priv->psz_configfile = config_GetCustomConfigFile( p_libvlc );
......@@ -1061,7 +1060,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
module_EndBank( p_libvlc );
FREENULL( p_libvlc->psz_homedir );
free( priv->psz_configdir );
free( priv->psz_datadir );
FREENULL( priv->psz_configfile );
var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
......
......@@ -211,7 +211,6 @@ typedef struct libvlc_priv_t
/* Configuration */
vlc_mutex_t config_lock; ///< config file lock
char * psz_configfile; ///< location of config file
char *psz_configdir; ///< user configuration directory
char *psz_datadir; ///< user data directory
/* There is no real reason to keep a list of items, but not to break
......
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