1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-08 16:07:16 +00:00

config: don't write default config file

This created an essentially empty config file. This is not really
needed and probably causes more trouble than it solves (such as
littering the home directory with crap), so get rid of it.
This commit is contained in:
wm4 2014-02-25 20:31:48 +01:00
parent 90b4923f4a
commit 2ea614ada6

View File

@ -44,8 +44,6 @@
#include "core.h"
#include "command.h"
#define DEF_CONFIG "# Write your default config options here!\n\n\n"
bool mp_parse_cfgfiles(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
@ -71,18 +69,10 @@ bool mp_parse_cfgfiles(struct MPContext *mpctx)
mp_mk_config_dir(mpctx->global, NULL);
if (!(conffile = mp_find_user_config_file(tmp, mpctx->global, "config")))
MP_ERR(mpctx, "mp_find_user_config_file(\"config\") problem\n");
else {
int fd = open(conffile, O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC, 0666);
if (fd != -1) {
MP_INFO(mpctx, "Creating config file: %s\n", conffile);
write(fd, DEF_CONFIG, sizeof(DEF_CONFIG) - 1);
close(fd);
}
if (m_config_parse_config_file(conf, conffile, 0) < 0) {
else if (m_config_parse_config_file(conf, conffile, 0) < 0) {
r = false;
goto done;
}
}
done:
talloc_free(tmp);