summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-22 20:13:21 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-22 20:13:21 +0000
commite666ce933ade5a8c244d2ed933f344bd33b317ba (patch)
tree03ec0dfbcd3a65480a0684e00a56f4838c402365
parentd841ca9797f7ba1dcc9b328d12b48caa5850aaec (diff)
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
-rw-r--r--firmware/common/file.c4
1 files changed, 1 insertions, 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;