summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtle Hellvik Havsø <atle@havso.net>2010-11-28 15:18:07 +0100
committerAtle Hellvik Havsø <atle@havso.net>2010-11-28 15:18:07 +0100
commit3a9d89c2abf1fb2eb2cc465a91f2cd3a1ea0750d (patch)
treecf45122dda4660d8d7b74c026031c7a29466abd4
parentf56a38083c7e2c4a5f6c333197a3753a642e258d (diff)
Command line arguments takes precedence over values from the configuration file.
Signed-off-by: Atle Hellvik Havsø <atle@havso.net>
-rw-r--r--common/config.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/config.cpp b/common/config.cpp
index 1649e23..f106304 100644
--- a/common/config.cpp
+++ b/common/config.cpp
@@ -50,8 +50,11 @@ void Config::load_conf(){
std::string config_line;
std::getline(config_file, config_line);
std::string id = config_line.substr(0, config_line.find("=") - 1);
- std::string value = config_line.substr(config_line.find("=") + 2, config_line.length()-1);
- config[id] = value;
+ //Skip empty lines
+ if (id != "") {
+ std::string value = config_line.substr(config_line.find("=") + 2, config_line.length()-1);
+ config[id] = value;
+ }
}
config_file.close();