From fa09debae62c900129855fe03932ab0ceef2d0b0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 Nov 2011 20:30:39 +0000 Subject: Revised FAT bugfix git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4104 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/fs/fat/fs_fat32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nuttx/fs/fat/fs_fat32.c') diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c index b0ee57a18..22c285c40 100644 --- a/nuttx/fs/fat/fs_fat32.c +++ b/nuttx/fs/fat/fs_fat32.c @@ -1494,7 +1494,7 @@ static int fat_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir) } /* Check if this is the root directory. If it is the root directory, we - * reset the fd_index to 1, skipping over the initial, unused entry. + * reset the fd_index to 0, starting with the initial, entry. */ if (fs->fs_type != FSTYPE_FAT32 && @@ -1504,7 +1504,7 @@ static int fat_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir) dir->u.fat.fd_currcluster = 0; dir->u.fat.fd_currsector = fs->fs_rootbase; - dir->u.fat.fd_index = 1; + dir->u.fat.fd_index = 0; } else if (fs->fs_type == FSTYPE_FAT32 && dir->u.fat.fd_startcluster == fs->fs_rootbase) @@ -1513,7 +1513,7 @@ static int fat_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir) dir->u.fat.fd_currcluster = dir->u.fat.fd_startcluster; dir->u.fat.fd_currsector = fat_cluster2sector(fs, fs->fs_rootbase); - dir->u.fat.fd_index = 1; + dir->u.fat.fd_index = 0; } /* This is not the root directory. Here the fd_index is set to 2, skipping over -- cgit v1.2.3