fix
diff --git a/kernel/dir.c b/kernel/dir.c
index ecd6108..093bbb9 100644
--- a/kernel/dir.c
+++ b/kernel/dir.c
@@ -506,19 +506,19 @@
struct fuse_dirent *dirent = (struct fuse_dirent *) buf;
size_t reclen = FUSE_DIRENT_SIZE(dirent);
int over;
- if (dirent->namelen > FUSE_NAME_MAX)
+ if (!dirent->namelen || dirent->namelen > FUSE_NAME_MAX)
return -EIO;
if (reclen > nbytes)
break;
over = filldir(dstbuf, dirent->name, dirent->namelen,
- dirent->off, dirent->ino, dirent->type);
+ file->f_pos, dirent->ino, dirent->type);
if (over)
break;
buf += reclen;
- file->f_pos += reclen;
nbytes -= reclen;
+ file->f_pos = dirent->off;
}
return 0;