summaryrefslogtreecommitdiff
path: root/firmware/common/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r--firmware/common/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 202410db81..2012e2ff80 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -1056,7 +1056,7 @@ int rename(const char *old, const char *new)
1056 FILE_ERROR(EINVAL, -4); 1056 FILE_ERROR(EINVAL, -4);
1057 } 1057 }
1058 1058
1059 const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length); 1059 //const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length);
1060 const char * const newname = strmemdupa(newinfo.name, newinfo.length); 1060 const char * const newname = strmemdupa(newinfo.name, newinfo.length);
1061 bool is_overwrite = false; 1061 bool is_overwrite = false;
1062 1062
@@ -1076,7 +1076,8 @@ int rename(const char *old, const char *new)
1076 FILE_ERROR(ERRNO, rc * 10 - 5); 1076 FILE_ERROR(ERRNO, rc * 10 - 5);
1077 } 1077 }
1078 } 1078 }
1079 else if (!strcmp(newname, oldname)) /* case-only is ok */ 1079 else if (!strncmp(newname, oldinfo.name, oldinfo.length) && /* case-only is ok */
1080 newname[oldinfo.length] == '\0') /* make sure of actual match */
1080 { 1081 {
1081 DEBUGF("No name change (success)\n"); 1082 DEBUGF("No name change (success)\n");
1082 rc = 0; 1083 rc = 0;