1
0
mirror of https://github.com/golang/go synced 2024-11-19 11:04:47 -07:00
go/src/path/filepath
Emil Hessman 8128b0116d path/filepath: make Join handle UNC paths on Windows
Unless the first element is a Universal Naming Convention (UNC)[0]
path, Join shouldn't create a UNC path on Windows.

For example, Join inadvertently creates a UNC path on Windows when
told to join at least three non-empty path elements, where the first
element is `\` or `/`.

This CL prevents creation of a UNC path prefix when the first path
element isn't a UNC path.

Since this introduces some amount of Windows-specific logic, Join is
moved to a per GOOS implementation.

Fixes #9167.

[0]: http://msdn.microsoft.com/en-us/library/gg465305.aspx

Change-Id: Ib6eda597106cb025137673b33c4828df1367f75b
Reviewed-on: https://go-review.googlesource.com/2211
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-01-20 23:23:01 +00:00
..
example_unix_test.go
export_test.go
match_test.go
match.go
path_plan9.go path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
path_test.go path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
path_unix.go path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
path_windows_test.go
path_windows.go path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
path.go path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
symlink_unix.go
symlink_windows.go
symlink.go