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
}
// Check the offset.
if req.Offset >= fuse.DirOffset(len(entries)) {
// Grab the range of interest.
if req.Offset > fuse.DirOffset(len(entries)) {
err = fuse.EIO
return
}
entries = entries[req.Offset:]
// Resume at the specified offset into the array.
for _, e := range entries {
resp.Data = fuseutil.AppendDirent(resp.Data, e)