
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

In the case of dotsOK, re-initialization of "ptname" pointer is needed,
otherwise, "ptname" is pointing the previous start position.

This fixes it.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/fat/dir.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff -puN fs/fat/dir.c~fat-fat_readdirx-with-dotok=yes-fix fs/fat/dir.c
--- 25/fs/fat/dir.c~fat-fat_readdirx-with-dotok=yes-fix	Sun Mar  6 17:13:06 2005
+++ 25-akpm/fs/fat/dir.c	Sun Mar  6 17:13:06 2005
@@ -442,9 +442,13 @@ ParseLong:
 			long_slots = 0;
 	}
 
-	if ((de->attr & ATTR_HIDDEN) && MSDOS_SB(sb)->options.dotsOK) {
-		*ptname++ = '.';
-		dotoffset = 1;
+	if (MSDOS_SB(sb)->options.dotsOK) {
+		ptname = bufname;
+		dotoffset = 0;
+		if (de->attr & ATTR_HIDDEN) {
+			*ptname++ = '.';
+			dotoffset = 1;
+		}
 	}
 
 	memcpy(work, de->name, sizeof(de->name));
_
