mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 03:08:35 -07:00
Fail early on actual rename
This commit is contained in:
@@ -428,6 +428,10 @@ bool storage_is_subdir(const char* a, const char* b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FS_Error storage_common_rename(Storage* storage, const char* old_path, const char* new_path) {
|
FS_Error storage_common_rename(Storage* storage, const char* old_path, const char* new_path) {
|
||||||
|
if(!storage_common_exists(storage, old_path)) {
|
||||||
|
return FSE_NOT_EXIST;
|
||||||
|
}
|
||||||
|
|
||||||
if(storage_is_subdir(new_path, old_path)) {
|
if(storage_is_subdir(new_path, old_path)) {
|
||||||
return FSE_INVALID_NAME;
|
return FSE_INVALID_NAME;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user