diff options
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -36,6 +36,7 @@ #include "cfgparser.h" #include "cfg-mplayer-func.h" +#include "cfg-mplayer-def.h" #include "libvo/video_out.h" @@ -374,6 +375,8 @@ char *dsp="/dev/dsp"; int force_ni=0; char *homedir; char conffile[100]; +char confdir[100]; +int conffile_fd; #include "cfg-mplayer.h" printf("%s",banner_text); @@ -383,7 +386,13 @@ if (parse_config_file(conf, "/etc/mplayer.conf") < 0) if ((homedir = getenv("HOME")) == NULL) { printf("Can't find HOME dir\n"); } else { - snprintf(conffile, 100, "%s/.mplayerrc", homedir); + snprintf(confdir, 100, "%s/.mplayer", homedir); + mkdir(confdir, 0777); + snprintf(conffile, 100, "%s/config", confdir); + if ((conffile_fd = open(conffile, O_CREAT | O_EXCL | O_WRONLY, 0644)) != -1) { + write(conffile_fd, default_config, strlen(default_config)); + close(conffile_fd); + } if (parse_config_file(conf, conffile) < 0) exit(1); } |