diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-15 15:56:19 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-15 15:56:19 +0000 |
commit | 54353e04b116bb78edc529e7bf6687a845923b65 (patch) | |
tree | 5c083d7c1ea4f0fa7d1805af02a9660fb15c1924 /firmware/drivers/fat.c | |
parent | d815ad60355558eddbfc338c481aa83fdf0a1e43 (diff) | |
download | rockbox-54353e04b116bb78edc529e7bf6687a845923b65.tar.gz rockbox-54353e04b116bb78edc529e7bf6687a845923b65.zip |
Second bug in mkdir() :-)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4241 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r-- | firmware/drivers/fat.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, | |||
1340 | LDEBUGF("fat_create_dir(\"%s\",%x,%x)\n",name,newdir,dir); | 1340 | LDEBUGF("fat_create_dir(\"%s\",%x,%x)\n",name,newdir,dir); |
1341 | 1341 | ||
1342 | memset(newdir, sizeof(struct fat_dir), 0); | 1342 | memset(newdir, sizeof(struct fat_dir), 0); |
1343 | memset(&dummyfile, sizeof(struct fat_file), 0); | ||
1343 | 1344 | ||
1344 | /* First, add the entry in the parent directory */ | 1345 | /* First, add the entry in the parent directory */ |
1345 | rc = add_dir_entry(dir, &newdir->file, name, true, false); | 1346 | rc = add_dir_entry(dir, &newdir->file, name, true, false); |
@@ -1347,6 +1348,9 @@ int fat_create_dir(char* name, | |||
1347 | return rc * 10 - 1; | 1348 | return rc * 10 - 1; |
1348 | 1349 | ||
1349 | /* Then add the "." entry */ | 1350 | /* Then add the "." entry */ |
1351 | newdir->file.firstcluster = find_free_cluster(fat_bpb.fsinfo.nextfree); | ||
1352 | update_fat_entry(newdir->file.firstcluster, FAT_EOF_MARK); | ||
1353 | |||
1350 | rc = add_dir_entry(newdir, &dummyfile, ".", true, true); | 1354 | rc = add_dir_entry(newdir, &dummyfile, ".", true, true); |
1351 | if (rc < 0) | 1355 | if (rc < 0) |
1352 | return rc * 10 - 2; | 1356 | return rc * 10 - 2; |