summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-05-27 14:04:18 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-05-27 14:04:18 +0000
commit14a20d54b382081b651b63a535a04dc74f01130b (patch)
tree2d84901f1b929752eed7db195393ed709ea29ea6
parent76d0c7d790cfdcad7e4771f09f02a222571d0c25 (diff)
downloadrockbox-14a20d54b382081b651b63a535a04dc74f01130b.tar.gz
rockbox-14a20d54b382081b651b63a535a04dc74f01130b.zip
fat_seek couldn't seek in the first cluster
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@751 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/fat.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 15974f4cbc..9a81107725 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -891,7 +891,7 @@ int fat_read( struct fat_file *file, int sectorcount, void* buf )
891int fat_seek(struct fat_file *file, int seeksector ) 891int fat_seek(struct fat_file *file, int seeksector )
892{ 892{
893 int cluster = file->firstcluster; 893 int cluster = file->firstcluster;
894 int sector = seeksector; 894 int sector = cluster2sec(cluster);
895 int numsec = 0; 895 int numsec = 0;
896 int i; 896 int i;
897 897
@@ -913,11 +913,6 @@ int fat_seek(struct fat_file *file, int seeksector )
913 sector++; 913 sector++;
914 } 914 }
915 } 915 }
916 else {
917 sector = cluster2sec(cluster);
918 if (sector<0)
919 return -2;
920 }
921 916
922 file->nextcluster = cluster; 917 file->nextcluster = cluster;
923 file->nextsector = sector; 918 file->nextsector = sector;