From 676542dcce03a1860fac8bb0638e5bb8ccb8ddce Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 11 Jul 2011 19:20:26 +0000 Subject: [PATCH] explanatory comment about use of g_strncasecmp() git-svn-id: svn://localhost/ardour2/branches/3.0@9840 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/utils.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 4b7fdc2f91..3a5ea0084a 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -565,6 +565,13 @@ string_is_affirmative (const std::string& str) return false; } + /* the use of g_strncasecmp() is solely to get around issues with + * charsets posed by trying to use C++ for the same + * comparison. switching a std::string to its lower- or upper-case + * version has several issues, but handled by default + * in the way we desire when doing it in C. + */ + return str == "1" || str == "y" || str == "Y" || (!g_strncasecmp(str.c_str(), "yes", str.length())); }