return 'def' on the empty string again

This commit is contained in:
Gunter Labes 2008-01-06 19:10:02 +00:00
parent bb78efd8fb
commit a140a3773e

View file

@ -394,6 +394,7 @@ std::string &unescape(std::string &str)
}
bool string_bool(const std::string& str, bool def) {
if (str.empty()) return def;
if (str == "yes" || str == "on" || str == "true"
|| lexical_cast_default<int>(str), 0) {
return true;