From 0a488fb155a9728fa09e72cd65ed7632feecaf3b Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 18 Nov 2002 14:55:05 +0000 Subject: Bug fixes: 1) add_dir_entry() would update end-of-dir marker even when not supposed to. 2) create_dos_name() didn't treat spaces correctly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2854 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index a3ed62e4bc..2ff36e2595 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -841,7 +841,6 @@ static int add_dir_entry(struct fat_dir* dir, entries_found = entries_needed; LDEBUGF("Found last entry %d\n", sector * DIR_ENTRIES_PER_SECTOR + i); - last = true; done = true; break; @@ -873,7 +872,9 @@ static int add_dir_entry(struct fat_dir* dir, /* if we're not extending the dir, we must go back to first free entry */ - if (!last) + if (done) + last = true; + else firstentry -= (entries_needed - 1); } } @@ -951,6 +952,7 @@ unsigned char char2dos(unsigned char c) case 0xe5: /* Special kanji character */ c = 0x05; break; + case 0x20: case 0x22: case 0x2a: case 0x2b: -- cgit v1.2.3