From: <geo...@us...> - 2007-04-12 05:23:44
|
Revision: 2035 http://svn.sourceforge.net/freeorion/revision/?rev=2035&view=rev Author: geoffthemedio Date: 2007-04-11 22:23:44 -0700 (Wed, 11 Apr 2007) Log Message: ----------- Fixed [ 1695962 ] freeoriond doesn't allow "-" in --settings-dir's argument Modified Paths: -------------- trunk/FreeOrion/util/OptionsDB.cpp Modified: trunk/FreeOrion/util/OptionsDB.cpp =================================================================== --- trunk/FreeOrion/util/OptionsDB.cpp 2007-03-23 08:55:38 UTC (rev 2034) +++ trunk/FreeOrion/util/OptionsDB.cpp 2007-04-12 05:23:44 UTC (rev 2035) @@ -315,10 +315,10 @@ StripQuotation(value_str); // ensure parameter is actually a parameter, and not the next option name (which would indicate // that the option was specified without a parameter value, as if it was a flag) - if (value_str.find("-") != std::string::npos) + if (value_str.at(0) == '-') throw std::runtime_error("the option \"" + option.name + "\" was followed by the parameter \"" + value_str + - "\", which appears to be an option flag, not a parameter value, because it contains a \"-\" character."); + "\", which appears to be an option flag, not a parameter value, because it begins with a \"-\" character."); option.FromString(value_str); } catch (const std::exception& e) { throw std::runtime_error("OptionsDB::SetFromCommandLine() : the following exception was caught when attemptimg to set option \"" + option.name + "\": " + e.what() + "\n\n"); |