]> git.sesse.net Git - stockfish/commit
Fix get_option_value() for strings with spaces
authorMarco Costalba <mcostalba@gmail.com>
Sat, 28 Nov 2009 16:31:56 +0000 (17:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 28 Nov 2009 16:31:56 +0000 (17:31 +0100)
commit455993b289b3c8f1c9c73af5876eb0190cde537c
treeaab1d0e7d6a259ac77460bf2635d4a8edfe3e330
parentc7a77dd3c01564c5d4bcd8029a1a48e18356df35
Fix get_option_value() for strings with spaces

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>
src/ucioption.cpp