8000 cleanPath: use path.IsAbs after converting ToSlash · etherscan-io/sftp@118ca57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 118ca57

Browse files
committed
cleanPath: use path.IsAbs after converting ToSlash
we need a POSIX path filepath.IsAbs can give unexpected results on Windows
1 parent 2fc6848 commit 118ca57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

request-server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func cleanPacketPath(pkt *sshFxpRealpathPacket) responsePacket {
258258
// Makes sure we have a clean POSIX (/) absolute path to work with
259259
func cleanPath(p string) string {
260260
p = filepath.ToSlash(p)
261-
if !filepath.IsAbs(p) {
261+
if !path.IsAbs(p) {
262262
p = "/" + p
263263
}
264264
return path.Clean(p)

0 commit comments

Comments
 (0)
0