fix: windows tests for all cases (#9594)

Replaces #9299
This commit is contained in:
Klaus Post
2020-05-14 08:55:38 +02:00
committed by GitHub
parent 9c85928740
commit ee9077db7d
7 changed files with 74 additions and 44 deletions
+5 -4
View File
@@ -110,10 +110,7 @@ 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" {
if len(pathName) <= 1024 {
return nil
}
if runtime.GOOS == "windows" && len(pathName) > 1024 {
return errFileNameTooLong
}
@@ -130,6 +127,10 @@ func checkPathLength(pathName string) error {
switch p {
case '/':
count = 0 // Reset
case '\\':
if runtime.GOOS == globalWindowsOSName {
count = 0
}
default:
count++
if count > 255 {