1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith

This commit is contained in:
Rubidium
2023-04-27 13:21:08 +02:00
committed by rubidium42
parent 86786a7af6
commit 4dd5f994be
10 changed files with 410 additions and 41 deletions

View File

@@ -386,7 +386,7 @@ static void FiosGetFileList(SaveLoadOperation fop, fios_getlist_callback_proc *c
/* found file must be directory, but not '.' or '..' */
if (FiosIsValidFile(_fios_path->c_str(), dirent, &sb) && S_ISDIR(sb.st_mode) &&
(!FiosIsHiddenFile(dirent) || strncasecmp(d_name, PERSONAL_DIR, strlen(d_name)) == 0) &&
(!FiosIsHiddenFile(dirent) || StrStartsWithIgnoreCase(PERSONAL_DIR, d_name)) &&
strcmp(d_name, ".") != 0 && strcmp(d_name, "..") != 0) {
fios = &file_list.emplace_back();
fios->type = FIOS_TYPE_DIR;