mirror of https://github.com/pkg/sftp.git
cleanPath: use path.IsAbs after converting ToSlash
we need a POSIX path filepath.IsAbs can give unexpected results on Windows
This commit is contained in:
parent
18dc4db7a4
commit
166a37e8c0
|
|
@ -232,7 +232,7 @@ func cleanPacketPath(pkt *sshFxpRealpathPacket) responsePacket {
|
|||
// Makes sure we have a clean POSIX (/) absolute path to work with
|
||||
func cleanPath(p string) string {
|
||||
p = filepath.ToSlash(p)
|
||||
if !filepath.IsAbs(p) {
|
||||
if !path.IsAbs(p) {
|
||||
p = "/" + p
|
||||
}
|
||||
return path.Clean(p)
|
||||
|
|
|
|||
Loading…
Reference in New Issue