aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-28 00:21:39 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-28 00:21:39 +0000
commitfa6f95685b8311be52e32aebc4ac86e8470b1fa3 (patch)
tree8e30c7e13d76124ccafd39a580dd048eb55d22bf /src/main.c
parent3e6a8042cadb03776e153aa1d7acab42b70d0c23 (diff)
downloadmpd-fa6f95685b8311be52e32aebc4ac86e8470b1fa3.tar.gz
mpd-fa6f95685b8311be52e32aebc4ac86e8470b1fa3.tar.xz
mpd-fa6f95685b8311be52e32aebc4ac86e8470b1fa3.zip
getting closer to being done with initial config file rewrite
git-svn-id: https://svn.musicpd.org/mpd/branches/shank-rewrite-config@2372 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index ddde281a7..a73d778cf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -166,7 +166,7 @@ void parseOptions(int argc, char ** argv, Options * options) {
}
else if(argcLeft<=2) {
char ** conf = NULL;
- if(argcLeft==2) conf = readConf(argv[argc-1]);
+ if(argcLeft==2) readConf(argv[argc-1]);
if(argcLeft==1) {
FILE * fp;
char * homedir = getenv("HOME");
@@ -179,22 +179,26 @@ void parseOptions(int argc, char ** argv, Options * options) {
}
if(strlen(userfile) && (fp=fopen(userfile,"r"))) {
fclose(fp);
- conf = readConf(userfile);
+ readConf(userfile);
}
else if((fp=fopen(SYSTEM_CONFIG_FILE_LOCATION,"r"))) {
fclose(fp);
- conf = readConf(SYSTEM_CONFIG_FILE_LOCATION);
+ readConf(SYSTEM_CONFIG_FILE_LOCATION);
}
}
if(conf) {
- options->portStr = conf[CONF_PORT];
- options->musicDirArg = conf[CONF_MUSIC_DIRECTORY];
- options->playlistDirArg = conf[CONF_PLAYLIST_DIRECTORY];
- options->logFile = conf[CONF_LOG_FILE];
- options->errorFile = conf[CONF_ERROR_FILE];
- options->usr = conf[CONF_USER];
- if(conf[CONF_DB_FILE]) {
- options->dbFile = conf[CONF_DB_FILE];
+ options->portStr = getConfigParamValue(CONF_PORT);
+ options->musicDirArg =
+ getConfigParamValue(CONF_MUSIC_DIR);
+ options->playlistDirArg =
+ getConfigParamValue(CONF_PLAYLIST_DIR);
+ options->logFile = getConfigParamValue(CONF_LOG_FILE);
+ options->errorFile =
+ getConfigParamValue(CONF_ERROR_FILE);
+ options->usr = getConfigParamValue(CONF_USER);
+ if(getConfigParamValue(CONF_DB_FILE)) {
+ options->dbFile =
+ getConfigParamValue(CONF_DB_FILE);
}
return;
}