Skip to content

Commit

Permalink
Merge pull request #456 from uyjulian/fatfs_rename_same_ignore
Browse files Browse the repository at this point in the history
bdmfs_fatfs: do not rename if old and new path are same
  • Loading branch information
rickgaiser authored Jul 31, 2023
2 parents 497044b + db1e898 commit b88e427
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iop/fs/bdmfs_fatfs/src/fs_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,11 @@ int fs_rename(iop_file_t *fd, const char *path, const char *newpath)
FATFS_FS_DRIVER_NAME_ALLOC_ON_STACK_IMPLEMENTATION(path, fd);
FATFS_FS_DRIVER_NAME_ALLOC_ON_STACK_IMPLEMENTATION(newpath, fd);

// If old and new path are the same, no need to do anything
if (strcmp(modified_path, modified_newpath) == 0) {
return 0;
}

_fs_lock();

ret = f_rename(modified_path, modified_newpath);
Expand Down

0 comments on commit b88e427

Please sign in to comment.