mirror of
https://github.com/golang/go
synced 2024-11-25 06:17:58 -07:00
Change Stat to Lstat in Readdir so we don't recur when someone symlinks "."
R=rsc CC=go-dev http://go/go-review/1018003
This commit is contained in:
parent
b89d630977
commit
449086eec9
@ -315,7 +315,7 @@ func (file *File) Readdir(count int) (dirs []Dir, err Error) {
|
|||||||
}
|
}
|
||||||
dirs = make([]Dir, len(names));
|
dirs = make([]Dir, len(names));
|
||||||
for i, filename := range names {
|
for i, filename := range names {
|
||||||
dirp, err := Stat(dirname+filename);
|
dirp, err := Lstat(dirname+filename);
|
||||||
if dirp == nil || err != nil {
|
if dirp == nil || err != nil {
|
||||||
dirs[i].Name = filename; // rest is already zeroed out
|
dirs[i].Name = filename; // rest is already zeroed out
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user