mirror of https://github.com/spf13/afero.git
Merge pull request #240 from cugu/patch-1
Fix zipfs.Readdir and zipfs.Readdirnames
This commit is contained in:
commit
a2fefa4cb9
|
@ -130,7 +130,7 @@ func (f *File) Readdir(count int) (fi []os.FileInfo, err error) {
|
||||||
}
|
}
|
||||||
for _, zipfile := range zipfiles {
|
for _, zipfile := range zipfiles {
|
||||||
fi = append(fi, zipfile.FileInfo())
|
fi = append(fi, zipfile.FileInfo())
|
||||||
if count >= 0 && len(fi) >= count {
|
if count > 0 && len(fi) >= count {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ func (f *File) Readdirnames(count int) (names []string, err error) {
|
||||||
}
|
}
|
||||||
for filename := range zipfiles {
|
for filename := range zipfiles {
|
||||||
names = append(names, filename)
|
names = append(names, filename)
|
||||||
if count >= 0 && len(names) >= count {
|
if count > 0 && len(names) >= count {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue