]> Cypherpunks repositories - gostls13.git/commit
os: make MkdirAll support path in extended-length form
authorMansour Rahimi <rahimi.mnr@gmail.com>
Sun, 28 Jan 2018 21:19:13 +0000 (22:19 +0100)
committerAlex Brainman <alex.brainman@gmail.com>
Sun, 18 Feb 2018 03:44:53 +0000 (03:44 +0000)
commit7a1347a1a1f6e99627a8e9bf098351c13162e5d6
tree53815295c0a7cf784fd5b181824dcab385facfdf
parent1b1c8b34d129eefcdbad234914df999581e62b2f
os: make MkdirAll support path in extended-length form

Calling MkdirAll on paths in extended-length form (\\?\-prefixed)
failed.

MkdirAll calls itself recursively with parent directory of given path in
its parameter. It finds parent directory by looking for delimiter in
the path, and taking the left part. When path is in extended-length form,
it finds empty path at the end.

Here is a sample of path in extended-length form:
\\?\c:\foo\bar

This change fixes that by passing trailing path separator to MkdirAll (so
it works for path like \\?\c:\).

Fixes #22230

Change-Id: I363660b262588c5382ea829773d3b6005ab8df3c
Reviewed-on: https://go-review.googlesource.com/86295
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/os/path.go
src/os/path_windows_test.go