summaryrefslogtreecommitdiffstats
path: root/fs/fat/dir.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /fs/fat/dir.c
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'fs/fat/dir.c')
-rw-r--r--fs/fat/dir.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 594baa0e2..82d29a0df 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -295,6 +295,8 @@ static int fat_readdirx(
char bufname[14];
char *ptname = bufname;
int dotoffset = 0;
+ unsigned long *furrfu = &lpos;
+ unsigned long dummy;
cpos = filp->f_pos;
/* Fake . and .. for the root directory. */
@@ -305,8 +307,11 @@ static int fat_readdirx(
cpos++;
filp->f_pos++;
}
- if (cpos == 2)
+ if (cpos == 2) {
+ dummy = 2;
+ furrfu = &dummy;
cpos = 0;
+ }
}
if (cpos & (sizeof(struct msdos_dir_entry)-1))
return -ENOENT;
@@ -440,7 +445,7 @@ ParseLong:
if (!long_slots||shortnames) {
if (both)
bufname[i] = '\0';
- if (filldir(dirent, bufname, i, lpos, inum) < 0)
+ if (filldir(dirent, bufname, i, *furrfu, inum) < 0)
goto FillFailed;
} else {
char longname[275];
@@ -451,11 +456,12 @@ ParseLong:
memcpy(&longname[long_len+1], bufname, i);
long_len += i;
}
- if (filldir(dirent, longname, long_len, lpos, inum) < 0)
+ if (filldir(dirent, longname, long_len, *furrfu, inum) < 0)
goto FillFailed;
}
RecEnd:
+ furrfu = &lpos;
filp->f_pos = cpos;
goto GetNew;
EODir: