return 'def' on the empty string again
This commit is contained in:
parent
bb78efd8fb
commit
a140a3773e
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue