summaryrefslogtreecommitdiff
path: root/firmware/common/file_internal.c
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2023-11-23 08:10:46 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2023-11-23 21:26:13 -0500
commitcb3b5397b34eb6ad181b2c9d32996152f28d3974 (patch)
tree377d19a5c9a9af88bfb3b77271d0aa2fa75f09d9 /firmware/common/file_internal.c
parent53a47970e30bbe518442aa59e4ff5b126c66c581 (diff)
downloadrockbox-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_internal.c')
-rw-r--r--firmware/common/file_internal.c9
1 files changed, 4 insertions, 5 deletions
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,
433 int rc; 433 int rc;
434 434
435 /* create a null-terminated copy of the component name */ 435 /* create a null-terminated copy of the component name */
436 //char *compname = strmemdupa(compp->name, compp->length); 436 char *compname = strmemdupa(compp->name, compp->length);
437 437
438 unsigned int callflags = walkp->callflags; 438 unsigned int callflags = walkp->callflags;
439 struct pathwalk_component *parentp = compp->nextp; 439 struct pathwalk_component *parentp = compp->nextp;
@@ -455,8 +455,7 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp,
455 if (rc > 1 && !(callflags & FF_NOISO)) 455 if (rc > 1 && !(callflags & FF_NOISO))
456 iso_decode_d_name(dir_fatent.name); 456 iso_decode_d_name(dir_fatent.name);
457 457
458 if (!strncasecmp(compp->name, dir_fatent.name, compp->length) && 458 if (!strcasecmp(compname, dir_fatent.name))
459 dir_fatent.name[compp->length] == '\0') /* make sure of actual match */
460 break; 459 break;
461 } 460 }
462 461
@@ -475,8 +474,8 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp,
475 &compp->info.fatfile); 474 &compp->info.fatfile);
476 if (rc < 0) 475 if (rc < 0)
477 { 476 {
478 DEBUGF("I/O error opening file/directory %.*s (%d)\n", 477 DEBUGF("I/O error opening file/directory %s (%d)\n",
479 compp->length, compp->name, rc); 478 compname, rc);
480 return -EIO; 479 return -EIO;
481 } 480 }
482 481