mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
add dot and dot dot directories to sftp/ftp file listing
This commit is contained in:
@@ -608,3 +608,12 @@ func GetRedactedURL(rawurl string) string {
|
||||
}
|
||||
return u.Redacted()
|
||||
}
|
||||
|
||||
// PrependFileInfo prepends a file info to a slice in an efficient way.
|
||||
// We, optimistically, assume that the slice has enough capacity
|
||||
func PrependFileInfo(files []os.FileInfo, info os.FileInfo) []os.FileInfo {
|
||||
files = append(files, nil)
|
||||
copy(files[1:], files)
|
||||
files[0] = info
|
||||
return files
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user