Problem is that
istream& operator>> (istream& is, char* str );
according to C++ documentation "Ends extraction when the
next character is either a valid whitespace or a null character,
or if the End-Of-File is reached."
So if the parameter value is a string with spaces the currently
used instruction 'ss >> ret;' copies the chars only up to the first
white space and not the whole string.
Use a specialization of get_option_value() to fix this corner case.
Bug reported by xiaozhi
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
+ // Specialization for std::string where instruction 'ss >> ret;'
+ // would erroneusly tokenize a string with spaces.
+
+ template<>
+ string get_option_value<string>(const string& optionName) {
+
+ if (options.find(optionName) == options.end())
+ return string();
+
+ return options[optionName].currentValue;
+ }
+