Fixed a bug.

geesefs-0-30-9
Aaron Jacobs 2015-02-27 12:38:27 +11:00
parent 7b77e1d567
commit 137b24614a
1 changed files with 4 additions and 2 deletions

View File

@ -76,12 +76,14 @@ func (fs *HelloFS) ReadDir(
return return
} }
// Check the offset. // Grab the range of interest.
if req.Offset >= fuse.DirOffset(len(entries)) { if req.Offset > fuse.DirOffset(len(entries)) {
err = fuse.EIO err = fuse.EIO
return return
} }
entries = entries[req.Offset:]
// Resume at the specified offset into the array. // Resume at the specified offset into the array.
for _, e := range entries { for _, e := range entries {
resp.Data = fuseutil.AppendDirent(resp.Data, e) resp.Data = fuseutil.AppendDirent(resp.Data, e)