fix symbolic links issue on Linux. (#281)
Former-commit-id: 84a15d1ff70cbdcb91aaa7a40cb86604f036e349 [formerly 60e5a702fd98686193c5ee7bfb66698453de05ae] [formerly b863bd64cfc4e953c005f71ccc3fd936456b8a5e [formerly d269e239bf
]]
Former-commit-id: 24b6c15a5c3a54a866106eff843bea0d7401cf15 [formerly 6b6c3036a90776bb16d93a4b7e864e4f433f5531]
Former-commit-id: 5b7aacabf2ceb1a5303fd303d5132bbdd711362f
pull/726/head
parent
f61e71e44f
commit
52599314b0
10
file.go
10
file.go
|
@ -133,6 +133,16 @@ func (i *File) GetListing(u *User, r *http.Request) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(f.Mode().String(), "L") {
|
||||||
|
// It's a symbolic link
|
||||||
|
// The FileInfo from Readdir treats symbolic link as a file only.
|
||||||
|
info, err := os.Stat(f.Name())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
f = info
|
||||||
|
}
|
||||||
|
|
||||||
if f.IsDir() {
|
if f.IsDir() {
|
||||||
name += "/"
|
name += "/"
|
||||||
dirCount++
|
dirCount++
|
||||||
|
|
Loading…
Reference in New Issue