From 54353e04b116bb78edc529e7bf6687a845923b65 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 15 Jan 2004 15:56:19 +0000 Subject: Second bug in mkdir() :-) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4241 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'firmware/drivers') diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 55e6fa30cf..0a9f524c73 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -1340,6 +1340,7 @@ int fat_create_dir(char* name, LDEBUGF("fat_create_dir(\"%s\",%x,%x)\n",name,newdir,dir); memset(newdir, sizeof(struct fat_dir), 0); + memset(&dummyfile, sizeof(struct fat_file), 0); /* First, add the entry in the parent directory */ rc = add_dir_entry(dir, &newdir->file, name, true, false); @@ -1347,6 +1348,9 @@ int fat_create_dir(char* name, return rc * 10 - 1; /* Then add the "." entry */ + newdir->file.firstcluster = find_free_cluster(fat_bpb.fsinfo.nextfree); + update_fat_entry(newdir->file.firstcluster, FAT_EOF_MARK); + rc = add_dir_entry(newdir, &dummyfile, ".", true, true); if (rc < 0) return rc * 10 - 2; -- cgit v1.2.3