Fix STR_String Capitalize on non Win32
authorKarsten Weiss <>
Thu, 15 Dec 2016 01:56:48 +0000 (12:56 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Dec 2016 01:58:19 +0000 (12:58 +1100)
Harmless since its not used, but good to fix.

intern/string/intern/STR_String.cpp

index 4ea451311e4b4f7bd88aa5b1e4e7e85573f93073..4612c91b6a6579a2af1164426cc13df682517565 100644 (file)
@@ -545,9 +545,9 @@ STR_String& STR_String::Capitalize()
        if (this->m_len > 1) _strlwr(this->m_data + 1);
 #else
        if (this->m_len > 0)
-               this->m_data[0] = (this->m_data[0] >= 'A' && this->m_data[0] <= 'A') ? this->m_data[0] + 'a' - 'A' : this->m_data[0];
+               this->m_data[0] = (this->m_data[0] >= 'a' && this->m_data[0] <= 'z') ? this->m_data[0] + 'A' - 'a' : this->m_data[0];
        for (int i = 1; i < this->m_len; i++)
-               this->m_data[i] = (this->m_data[i] >= 'a' && this->m_data[i] <= 'z') ? this->m_data[i] + 'A' - 'a' : this->m_data[i];
+               this->m_data[i] = (this->m_data[i] >= 'A' && this->m_data[i] <= 'Z') ? this->m_data[i] + 'a' - 'A' : this->m_data[i];
 #endif
        return *this;
 }