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:
Nicola Murino 2020-06-06 19:26:12 +02:00
parent 18dc4db7a4
commit 166a37e8c0
1 changed files with 1 additions and 1 deletions

View File

@ -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)