summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index c68c4f3dc2..c57062517d 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -702,13 +702,14 @@ static bool parse_cfgfiles(struct MPContext *mpctx, m_config_t *conf)
if (!(opts->noconfig & 2) &&
m_config_parse_config_file(conf, MPLAYER_CONFDIR "/mpv.conf") < 0)
return false;
- if ((conffile = get_path("")) == NULL)
+ if ((conffile = mp_find_user_config_file("")) == NULL)
mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Cannot find HOME directory.\n");
else {
mkdir(conffile, 0777);
- free(conffile);
- if ((conffile = get_path("config")) == NULL)
- mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "get_path(\"config\") problem\n");
+ talloc_free(conffile);
+ if ((conffile = mp_find_user_config_file("config")) == NULL)
+ mp_tmsg(MSGT_CPLAYER, MSGL_ERR,
+ "mp_find_user_config_file(\"config\") problem\n");
else {
if ((conffile_fd = open(conffile, O_CREAT | O_EXCL | O_WRONLY,
0666)) != -1) {
@@ -720,7 +721,7 @@ static bool parse_cfgfiles(struct MPContext *mpctx, m_config_t *conf)
if (!(opts->noconfig & 1) &&
m_config_parse_config_file(conf, conffile) < 0)
return false;
- free(conffile);
+ talloc_free(conffile);
}
}
return true;
@@ -826,10 +827,10 @@ static void load_per_file_config(m_config_t *conf, const char * const file)
return;
}
- if ((confpath = get_path(name)) != NULL) {
+ if ((confpath = mp_find_user_config_file(name)) != NULL) {
try_load_config(conf, confpath);
- free(confpath);
+ talloc_free(confpath);
}
}