aboutsummaryrefslogtreecommitdiff
path: root/src/util/string.h
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-10-29 17:47:13 +1000
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-10-29 08:54:16 +0100
commit6c9bbb03609d79d455266935947f9bb844022972 (patch)
treee263ddc5d599ad5c33f361facefdcde7329e6e11 /src/util/string.h
parentdd4c21c1808acedfbcf8402c09ce9129b6ac31c7 (diff)
downloadminetest-6c9bbb03609d79d455266935947f9bb844022972.tar.gz
minetest-6c9bbb03609d79d455266935947f9bb844022972.tar.bz2
minetest-6c9bbb03609d79d455266935947f9bb844022972.zip
Fix bug introduced by me (Zeno)
Diffstat (limited to 'src/util/string.h')
-rw-r--r--src/util/string.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/string.h b/src/util/string.h
index 9f7b6673d..c983668a9 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -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;
}