mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-18 20:19:11 +00:00
(svn r22669) -Codechange: For non-windows, only test for file existence again if strtolower actually changed the name.
This commit is contained in:
@@ -319,10 +319,17 @@ size_t Utf8StringLength(const char *s)
|
||||
* 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.
|
||||
*/
|
||||
void strtolower(char *str)
|
||||
bool strtolower(char *str)
|
||||
{
|
||||
for (; *str != '\0'; str++) *str = tolower(*str);
|
||||
bool changed = false;
|
||||
for (; *str != '\0'; str++) {
|
||||
char new_str = tolower(*str);
|
||||
changed |= new_str != *str;
|
||||
*str = new_str;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user