Windows: Fixing longpath hanlding of UNC paths.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
parent
92c1310f61
commit
09a9d216d9
2 changed files with 28 additions and 1 deletions
|
@ -15,7 +15,12 @@ const Prefix = `\\?\`
|
|||
// it does not already have it.
|
||||
func AddPrefix(path string) string {
|
||||
if !strings.HasPrefix(path, Prefix) {
|
||||
path = Prefix + path
|
||||
if strings.HasPrefix(path, `\\`) {
|
||||
// This is a UNC path, so we need to add 'UNC' to the path as well.
|
||||
path = Prefix + `UNC` + path[1:]
|
||||
} else {
|
||||
path = Prefix + path
|
||||
}
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue