From 3a9d89c2abf1fb2eb2cc465a91f2cd3a1ea0750d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atle=20Hellvik=20Havs=C3=B8?= Date: Sun, 28 Nov 2010 15:18:07 +0100 Subject: Command line arguments takes precedence over values from the configuration file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Atle Hellvik Havsø --- common/config.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common') 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(); -- cgit v1.2.3