fix: windows tests for all cases (#9594)

Replaces #9299
This commit is contained in:
Klaus Post authored and GitHub committed 2020-05-13 23:55:38 -07:00
1 parent 9c85928740
commit ee9077db7d
7 files changed
+74 -44

No files matched your search

+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 {