Skip to content

Commit

Permalink
[FL-3808] Fix renaming directories with dots in archive (#3692)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsurkov authored Jun 8, 2024
1 parent 20c4121 commit 418a98c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions applications/main/archive/scenes/archive_scene_rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ void archive_scene_rename_on_enter(void* context) {

TextInput* text_input = archive->text_input;
ArchiveFile_t* current = archive_get_current_file(archive->browser);
const bool is_file = current->type != ArchiveFileTypeFolder;

FuriString* filename;
filename = furi_string_alloc();
path_extract_filename(current->path, filename, true);
path_extract_filename(current->path, filename, is_file);
strlcpy(archive->text_store, furi_string_get_cstr(filename), MAX_NAME_LEN);

path_extract_extension(current->path, archive->file_extension, MAX_EXT_LEN);
if(is_file) {
path_extract_extension(current->path, archive->file_extension, MAX_EXT_LEN);
} else {
memset(archive->file_extension, 0, sizeof(archive->file_extension));
}

text_input_set_header_text(text_input, "Rename:");

Expand Down

0 comments on commit 418a98c

Please sign in to comment.