Skip to content

Commit

Permalink
Archive: Fix .txt file type for /any paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Apr 9, 2024
1 parent e3c3ba4 commit fe85c51
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion applications/main/archive/helpers/archive_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder
txt_path = archive_get_default_path(ArchiveTabBadKb);
break;
}
if(txt_path != NULL && furi_string_start_with_str(file->path, txt_path)) {
if(txt_path != NULL) {
size_t len = strlen(txt_path);
if(furi_string_size(file->path) < len) continue;
// Compare but ignore /ext or /any, continue if different (memcmp() != 0)
if(memcmp(furi_string_get_cstr(file->path) + 4, txt_path + 4, len - 4)) {
continue;
}
file->type = i;
return;
}
Expand Down

0 comments on commit fe85c51

Please sign in to comment.