From 1c9dfb7647a6802c73a7aafa6f45f2e6249f5ab6 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 21 Oct 2010 10:29:45 +1100 Subject: [PATCH] os: correct Stat S_ISDIR on Windows R=rsc, brainman CC=golang-dev https://golang.org/cl/2598041 --- src/pkg/os/stat_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/os/stat_windows.go b/src/pkg/os/stat_windows.go index b5699d99375..11088436a3d 100644 --- a/src/pkg/os/stat_windows.go +++ b/src/pkg/os/stat_windows.go @@ -26,12 +26,12 @@ func fileInfoFromByHandleInfo(fi *FileInfo, name string, d *syscall.ByHandleFile func setFileInfo(fi *FileInfo, name string, fa, sizehi, sizelo uint32, ctime, atime, wtime syscall.Filetime) *FileInfo { fi.Mode = 0 - if fa == syscall.FILE_ATTRIBUTE_DIRECTORY { + if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 { fi.Mode = fi.Mode | syscall.S_IFDIR } else { fi.Mode = fi.Mode | syscall.S_IFREG } - if fa == syscall.FILE_ATTRIBUTE_READONLY { + if fa&syscall.FILE_ATTRIBUTE_READONLY != 0 { fi.Mode = fi.Mode | 0444 } else { fi.Mode = fi.Mode | 0666