Fix bug introduced by me (Zeno)
authorCraig Robbins <kde.psych@gmail.com>
Wed, 29 Oct 2014 07:47:13 +0000 (17:47 +1000)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Wed, 29 Oct 2014 07:54:16 +0000 (08:54 +0100)
src/util/string.h

index 9f7b6673dd0869b1ce6c624aff41cb460f99826b..c983668a9827a290e8587aa3e3e6d28ef57cc27d 100644 (file)
@@ -125,9 +125,10 @@ inline std::vector<std::string> str_split(const std::string &str, char delimiter
 
 inline std::string lowercase(const std::string &s)
 {
-       std::string s2;
+       std::string s2 = s;
        for(size_t i = 0; i < s.size(); i++)
-               s2[i] = tolower(s.at(i));
+               if (isupper(s2.at(i)))
+                       s2[i] = tolower(s2.at(i));
        return s2;
 }