diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-28 00:21:39 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-28 00:21:39 +0000 |
commit | fa6f95685b8311be52e32aebc4ac86e8470b1fa3 (patch) | |
tree | 8e30c7e13d76124ccafd39a580dd048eb55d22bf /src/main.c | |
parent | 3e6a8042cadb03776e153aa1d7acab42b70d0c23 (diff) | |
download | mpd-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.c | 26 |
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; } |