Commit 505f0bb3 authored by Alex Brainman's avatar Alex Brainman

os: fix windows version of Readdir(0)

Fixes #1893.

R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/4528106
parent b7582852
......@@ -145,9 +145,10 @@ func (file *File) Readdir(n int) (fi []FileInfo, err Error) {
return nil, &PathError{"Readdir", file.name, ENOTDIR}
}
di := file.dirinfo
wantAll := n < 0
wantAll := n <= 0
size := n
if size < 0 {
if wantAll {
n = -1
size = 100
}
fi = make([]FileInfo, 0, size) // Empty with room to grow.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment