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