summaryrefslogtreecommitdiff
path: root/firmware/common/file_internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/file_internal.c')
-rw-r--r--firmware/common/file_internal.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c
index a73d9beaa2..8e0df576bf 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,7 +455,8 @@ 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 (!strcasecmp(compname, dir_fatent.name)) 458 if (!strncasecmp(compp->name, dir_fatent.name, compp->length) &&
459 dir_fatent.name[compp->length] == '\0') /* make sure of actual match */
459 break; 460 break;
460 } 461 }
461 462
@@ -474,8 +475,8 @@ static NO_INLINE int open_path_component(struct pathwalk *walkp,
474 &compp->info.fatfile); 475 &compp->info.fatfile);
475 if (rc < 0) 476 if (rc < 0)
476 { 477 {
477 DEBUGF("I/O error opening file/directory %s (%d)\n", 478 DEBUGF("I/O error opening file/directory %.*s (%d)\n",
478 compname, rc); 479 compp->length, compp->name, rc);
479 return -EIO; 480 return -EIO;
480 } 481 }
481 482