From e666ce933ade5a8c244d2ed933f344bd33b317ba Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 22 Aug 2002 20:13:21 +0000 Subject: [PATCH] when we want to open a file, we want the exact specified file name, not just one that starts with our given string... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1929 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/firmware/common/file.c b/firmware/common/file.c index 663465bf76..c5f4cd5f5e 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -52,7 +52,6 @@ int open(char* pathname, int flags) struct dirent* entry; int fd; char* name; - int namelen; /* For now, we don't support writing */ if(flags & (O_WRONLY | O_RDWR)) @@ -101,9 +100,8 @@ int open(char* pathname, int flags) } /* scan dir for name */ - namelen = strlen(name); while ((entry = readdir(dir))) { - if ( !strncasecmp(name, entry->d_name, namelen) ) { + if ( !strcasecmp(name, entry->d_name) ) { fat_open(entry->startcluster, &(openfiles[fd].fatfile)); openfiles[fd].size = entry->size; break;