Skip to content

Commit

Permalink
- Hide .gcm.gcm and .iso.iso extensions.
Browse files Browse the repository at this point in the history
- Only copy new name if rename succeeds.
  • Loading branch information
Extrems committed Oct 31, 2024
1 parent 7a8c703 commit 1d08af6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ s32 deviceHandler_FAT_deleteFile(file_handle* file) {
s32 deviceHandler_FAT_renameFile(file_handle* file, char* name) {
deviceHandler_FAT_closeFile(file);
int ret = f_rename(file->name, name);
strcpy(file->name, name);
if(ret == FR_OK || ret == FR_NO_FILE)
strcpy(file->name, name);
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ s32 deviceHandler_Flippy_deleteFile(file_handle* file) {
s32 deviceHandler_Flippy_renameFile(file_handle* file, char* name) {
deviceHandler_Flippy_closeFile(file);
int ret = flippy_rename(getDevicePath(file->name), getDevicePath(name));
strcpy(file->name, name);
if(ret == FLIPPY_RESULT_OK || ret == FLIPPY_RESULT_NO_FILE)
strcpy(file->name, name);
return ret;
}

Expand Down
3 changes: 2 additions & 1 deletion cube/swiss/source/devices/fsp/deviceHandler-FSP.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ s32 deviceHandler_FSP_deleteFile(file_handle* file) {
s32 deviceHandler_FSP_renameFile(file_handle* file, char* name) {
deviceHandler_FSP_closeFile(file);
int ret = fsp_rename(fsp_session, getDevicePath(file->name), getDevicePath(name));
strcpy(file->name, name);
if(ret == 0)
strcpy(file->name, name);
return ret;
}

Expand Down
3 changes: 2 additions & 1 deletion cube/swiss/source/devices/ftp/deviceHandler-FTP.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ s32 deviceHandler_FTP_deleteFile(file_handle* file) {
s32 deviceHandler_FTP_renameFile(file_handle* file, char* name) {
deviceHandler_FTP_closeFile(file);
int ret = rename(file->name, name);
strcpy(file->name, name);
if(ret == 0)
strcpy(file->name, name);
return ret;
}

Expand Down
3 changes: 2 additions & 1 deletion cube/swiss/source/devices/smb/deviceHandler-SMB.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ s32 deviceHandler_SMB_deleteFile(file_handle* file) {
s32 deviceHandler_SMB_renameFile(file_handle* file, char* name) {
deviceHandler_SMB_closeFile(file);
int ret = rename(file->name, name);
strcpy(file->name, name);
if(ret == 0)
strcpy(file->name, name);
return ret;
}

Expand Down
3 changes: 3 additions & 0 deletions cube/swiss/source/gui/FrameBufferMagic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,12 @@ uiDrawObj_t* DrawFileBrowserButton(int x1, int y1, int x2, int y2, const char *m
|| (end = endsWith(start,".dol+cli"))
|| (end = endsWith(start,".elf"))
|| (end = endsWith(start,".gci"))
|| (end = endsWith(start,".gcm.gcm"))
|| (end = endsWith(start,".gcm"))
|| (end = endsWith(start,".gcs"))
|| (end = endsWith(start,".nkit.iso.iso"))
|| (end = endsWith(start,".nkit.iso"))
|| (end = endsWith(start,".iso.iso"))
|| (end = endsWith(start,".iso"))
|| (end = endsWith(start,".mp3"))
|| (end = endsWith(start,".sav"))
Expand Down

0 comments on commit 1d08af6

Please sign in to comment.