diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-02 21:25:44 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-02 21:25:44 +0000 |
commit | 9748669e06b9ee5555bac5f89dcee0f613857d05 (patch) | |
tree | 7620337997781b458ab03bd309aa32d43ca32fb7 | |
parent | 8f7aa040f7d8e9904c93929bcac1ed0a3a7e2f41 (diff) |
use drobilla's latest, not his penultimate, version of string_is_affirmitive()
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5724 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/utils.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 8fd5ca499f..98b51cb578 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -581,21 +581,13 @@ ARDOUR::auto_style_to_string (AutoStyle as) /*NOTREACHED*/ return ""; } + bool string_is_affirmative (const std::string& str) { /* to be used only with XML data - not intended to handle user input */ - if (str == "1" || str == "y" || str == "Y") { - return true; - } else { - std::string str_uc; - std::transform(str.begin(), str.end(), str_uc.begin(), ::toupper); - if (str_uc == "YES") { - return true; - } - } - return false; + return str == "1" || str == "y" || str == "Y" || (!g_strncasecmp(str.c_str(), "yes", str.length())); } extern "C" { |