diff options
Diffstat (limited to 'src/os/path_windows.go')
-rw-r--r-- | src/os/path_windows.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/os/path_windows.go b/src/os/path_windows.go index ccac1c0b64..101b026dc9 100644 --- a/src/os/path_windows.go +++ b/src/os/path_windows.go @@ -139,13 +139,16 @@ func dirname(path string) string { func fixLongPath(path string) string { // Do nothing (and don't allocate) if the path is "short". // Empirically (at least on the Windows Server 2013 builder), - // the kernel is arbitrarily okay with <= 248 bytes. That + // the kernel is arbitrarily okay with < 248 bytes. That // matches what the docs above say: // "When using an API to create a directory, the specified // path cannot be so long that you cannot append an 8.3 file // name (that is, the directory name cannot exceed MAX_PATH // minus 12)." Since MAX_PATH is 260, 260 - 12 = 248. - if len(path) <= 248 { + // + // The MSDN docs appear to say that a normal path that is 248 bytes long + // will work; empirically the path must be less then 248 bytes long. + if len(path) < 248 { // Don't fix. (This is how Go 1.7 and earlier worked, // not automatically generating the \\?\ form) return path |