From a2819d822a09f3c09835788d39c7eac6faafc6d2 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 16 Oct 2013 13:27:44 +0200 Subject: [PATCH] load data from server.ini only iff no parameters are give --- Util/ProgramOptions.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Util/ProgramOptions.h b/Util/ProgramOptions.h index ad02f3ef7..ba45f0570 100644 --- a/Util/ProgramOptions.h +++ b/Util/ProgramOptions.h @@ -215,8 +215,11 @@ inline bool GenerateServerProgramOptions( // parse config file ServerPaths::const_iterator path_iterator = paths.find("config"); - if( path_iterator != paths.end() && - boost::filesystem::is_regular_file(path_iterator->second)) { + if( + path_iterator != paths.end() && + boost::filesystem::is_regular_file(path_iterator->second) && + !option_variables.count("base") + ) { SimpleLogger().Write() << "Reading options from: " << path_iterator->second.string(); std::string config_str; @@ -229,8 +232,8 @@ inline bool GenerateServerProgramOptions( boost::program_options::notify(option_variables); } - if(!option_variables.count("hsgrdata")) { - if(!option_variables.count("base")) { + if( !option_variables.count("hsgrdata") ) { + if( !option_variables.count("base") ) { throw OSRMException("hsgrdata (or base) must be specified"); } paths["hsgrdata"] = std::string( paths["base"].string()) + ".hsgr";