diff options
author | William Wilgus <me.theuser@yahoo.com> | 2023-11-23 08:10:46 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2023-11-23 21:26:13 -0500 |
commit | cb3b5397b34eb6ad181b2c9d32996152f28d3974 (patch) | |
tree | 377d19a5c9a9af88bfb3b77271d0aa2fa75f09d9 /firmware/common/file.c | |
parent | 53a47970e30bbe518442aa59e4ff5b126c66c581 (diff) | |
download | rockbox-cb3b5397b34eb6ad181b2c9d32996152f28d3974.tar.gz rockbox-cb3b5397b34eb6ad181b2c9d32996152f28d3974.zip |
Revert "Extend path_append_ex to truncate compname, remove some strmemdupa"
This reverts commit dbe20d453d5e93bd0f1188a8851c6cf4fd230b26.
Reason for revert: Crashes ipod Classic
Change-Id: I9ea329ce73383535353832d17c7c5e494e5ad516
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r-- | firmware/common/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index 2012e2ff80..202410db81 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,8 +1076,7 @@ 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 (!strncmp(newname, oldinfo.name, oldinfo.length) && /* case-only is ok */ | 1079 | else if (!strcmp(newname, oldname)) /* case-only is ok */ |
1080 | newname[oldinfo.length] == '\0') /* make sure of actual match */ | ||
1081 | { | 1080 | { |
1082 | DEBUGF("No name change (success)\n"); | 1081 | DEBUGF("No name change (success)\n"); |
1083 | rc = 0; | 1082 | rc = 0; |