fix(blogo,gitea): fix implementatiion of ReadDir

This commit is contained in:
Guz
2025-01-09 10:40:40 -03:00
parent bba986e96a
commit bd06c47f0c

View File

@@ -187,10 +187,11 @@ func (f *repositoryDirFile) ReadDir(n int) ([]fs.DirEntry, error) {
return []fs.DirEntry{}, err return []fs.DirEntry{}, err
} }
start, end := f.n, f.n+n+1 start, end := f.n, f.n+n
if n <= 0 {
if end > len(list)-1 { start, end = 0, len(list)
end = len(list) + 1 } else if end > len(list) {
end = len(list)
err = io.EOF err = io.EOF
} }
@@ -207,6 +208,8 @@ func (f *repositoryDirFile) ReadDir(n int) ([]fs.DirEntry, error) {
}} }}
} }
f.n = end
return entries, err return entries, err
} }