]> Cypherpunks repositories - gostls13.git/commit
path: use OS-specific function in MkdirAll, don't always keep trailing slash
authorIan Lance Taylor <iant@golang.org>
Mon, 19 Feb 2018 21:26:01 +0000 (13:26 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 23 Feb 2018 18:37:09 +0000 (18:37 +0000)
commitb86e76681366447798c94abb959bb60875bcc856
treefa6dcc41748dc1355b88fb72d88850d72be7211e
parentbae3fd66279cf679b686ae68c35980334d9ff315
path: use OS-specific function in MkdirAll, don't always keep trailing slash

CL 86295 changed MkdirAll to always pass a trailing path separator to
support extended-length paths on Windows.

However, when Stat is called on an existing file followed by trailing
slash, it will return a "not a directory" error, skipping the fast
path at the beginning of MkdirAll.

This change fixes MkdirAll to only pass the trailing path separator
where required on Windows, by using an OS-specific function fixRootDirectory.

Updates #23918

Change-Id: I23f84a20e65ccce556efa743d026d352b4812c34
Reviewed-on: https://go-review.googlesource.com/95255
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/os/path.go
src/os/path_plan9.go
src/os/path_unix.go
src/os/path_windows.go