From cb3b5397b34eb6ad181b2c9d32996152f28d3974 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 23 Nov 2023 08:10:46 -0500 Subject: Revert "Extend path_append_ex to truncate compname, remove some strmemdupa" This reverts commit dbe20d453d5e93bd0f1188a8851c6cf4fd230b26. Reason for revert: Crashes ipod Classic Change-Id: I9ea329ce73383535353832d17c7c5e494e5ad516 --- firmware/common/file_internal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'firmware/common/file_internal.c') diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c index 8e0df576bf..a73d9beaa2 100644 --- a/firmware/common/file_internal.c +++ b/firmware/common/file_internal.c @@ -433,7 +433,7 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp, int rc; /* create a null-terminated copy of the component name */ - //char *compname = strmemdupa(compp->name, compp->length); + char *compname = strmemdupa(compp->name, compp->length); unsigned int callflags = walkp->callflags; struct pathwalk_component *parentp = compp->nextp; @@ -455,8 +455,7 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp, if (rc > 1 && !(callflags & FF_NOISO)) iso_decode_d_name(dir_fatent.name); - if (!strncasecmp(compp->name, dir_fatent.name, compp->length) && - dir_fatent.name[compp->length] == '\0') /* make sure of actual match */ + if (!strcasecmp(compname, dir_fatent.name)) break; } @@ -475,8 +474,8 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp, &compp->info.fatfile); if (rc < 0) { - DEBUGF("I/O error opening file/directory %.*s (%d)\n", - compp->length, compp->name, rc); + DEBUGF("I/O error opening file/directory %s (%d)\n", + compname, rc); return -EIO; } -- cgit v1.2.3