1
0
Fork 0
forked from len0rd/rockbox

Revert "Extend path_append_ex to truncate compname, remove some strmemdupa"

This reverts commit dbe20d453d.

Reason for revert: Crashes ipod Classic

Change-Id: I9ea329ce73383535353832d17c7c5e494e5ad516
This commit is contained in:
William Wilgus 2023-11-23 08:10:46 -05:00
parent 53a47970e3
commit cb3b5397b3
6 changed files with 56 additions and 122 deletions

View file

@ -1056,7 +1056,7 @@ int rename(const char *old, const char *new)
FILE_ERROR(EINVAL, -4);
}
//const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length);
const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length);
const char * const newname = strmemdupa(newinfo.name, newinfo.length);
bool is_overwrite = false;
@ -1076,8 +1076,7 @@ int rename(const char *old, const char *new)
FILE_ERROR(ERRNO, rc * 10 - 5);
}
}
else if (!strncmp(newname, oldinfo.name, oldinfo.length) && /* case-only is ok */
newname[oldinfo.length] == '\0') /* make sure of actual match */
else if (!strcmp(newname, oldname)) /* case-only is ok */
{
DEBUGF("No name change (success)\n");
rc = 0;