[FL-3888] Make file extensions case-insensitive (#3828)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Georgii Surkov
2024-08-09 08:14:40 +01:00
committed by GitHub
parent 3672efa7da
commit d2ff2825ca
6 changed files with 52 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder
} else {
for(size_t i = 0; i < COUNT_OF(known_ext); i++) {
if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue;
if(furi_string_end_with(file->path, known_ext[i])) {
if(furi_string_end_withi(file->path, known_ext[i])) {
if(i == ArchiveFileTypeBadUsb) {
if(furi_string_search(
file->path, archive_get_default_path(ArchiveTabBadUsb)) == 0) {

View File

@@ -134,7 +134,7 @@ static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, boo
if((furi_string_empty(ext)) || (furi_string_cmp_str(ext, "*") == 0)) {
return true;
}
if(furi_string_end_with(name, ext)) {
if(furi_string_end_withi(name, ext)) {
return true;
}
}