From fea4a1e68e9bf81b2997ca40b2c785d15b4a0748 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 4 May 2020 13:11:56 -0700 Subject: [PATCH] fix logical error in path length handling for windows (#9520) fixes #9515 --- cmd/posix.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/posix.go b/cmd/posix.go index 28e71e806..898386309 100644 --- a/cmd/posix.go +++ b/cmd/posix.go @@ -110,8 +110,11 @@ func checkPathLength(pathName string) error { // Disallow more than 1024 characters on windows, there // are no known name_max limits on Windows. - if runtime.GOOS == "windows" && len(pathName) > 1024 { - return nil + if runtime.GOOS == "windows" { + if len(pathName) <= 1024 { + return nil + } + return errFileNameTooLong } // On Unix we reject paths if they are just '.', '..' or '/'