mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 19:08:55 +00:00
Handle empty files correctly
This commit is contained in:
parent
3de989b7bb
commit
8418fed18e
@ -130,6 +130,12 @@ func (f *file) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
|
|||||||
return errors.New("offset greater than files size")
|
return errors.New("offset greater than files size")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle special case: file is empty
|
||||||
|
if f.node.Size == 0 {
|
||||||
|
resp.Data = resp.Data[:0]
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Skip blobs before the offset
|
// Skip blobs before the offset
|
||||||
startContent := 0
|
startContent := 0
|
||||||
for offset > int64(f.sizes[startContent]) {
|
for offset > int64(f.sizes[startContent]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user