From 4adb8dbf7071da215e7f437d5640be30c1819b1a Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Tue, 29 Aug 2017 14:56:13 -0400 Subject: [PATCH] Convert samba drive paths to UNC paths --- src/duplicacy_utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/duplicacy_utils.go b/src/duplicacy_utils.go index 3770c66..feda7ac 100644 --- a/src/duplicacy_utils.go +++ b/src/duplicacy_utils.go @@ -282,6 +282,10 @@ func joinPath(components ...string) string { combinedPath := path.Join(components...) if len(combinedPath) > 257 && runtime.GOOS == "windows" { combinedPath = `\\?\` + filepath.Join(components...) + // If the path is on a samba drive we must use the UNC format + if strings.HasPrefix(combinedPath, `\\?\\\`) { + combinedPath = `\\?\UNC\` + combinedPath[6:] + } } return combinedPath }