Cleanup: char-pointer variant of strtolower

This commit is contained in:
Rubidium 2023-06-08 17:09:56 +02:00 committed by rubidium42
parent b49bd86a46
commit 4ca23a19b6
2 changed files with 0 additions and 23 deletions

View File

@ -471,28 +471,6 @@ size_t Utf8StringLength(const std::string &str)
return Utf8StringLength(str.c_str());
}
/**
* Convert a given ASCII string to lowercase.
* NOTE: only support ASCII characters, no UTF8 fancy. As currently
* the function is only used to lowercase data-filenames if they are
* not found, this is sufficient. If more, or general functionality is
* needed, look to r7271 where it was removed because it was broken when
* using certain locales: eg in Turkish the uppercase 'I' was converted to
* '?', so just revert to the old functionality
* @param str string to convert
* @return String has changed.
*/
bool strtolower(char *str)
{
bool changed = false;
for (; *str != '\0'; str++) {
char new_str = tolower(*str);
changed |= new_str != *str;
*str = new_str;
}
return changed;
}
bool strtolower(std::string &str, std::string::size_type offs)
{
bool changed = false;

View File

@ -43,7 +43,6 @@ void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPL
void str_fix_scc_encoded(char *str, const char *last) NOACCESS(2);
void str_strip_colours(char *str);
bool strtolower(char *str);
bool strtolower(std::string &str, std::string::size_type offs = 0);
[[nodiscard]] bool StrValid(const char *str, const char *last) NOACCESS(2);