diff --git a/src/restic/fs/file.go b/src/restic/fs/file.go index b11dfb48c..a2e6822f6 100644 --- a/src/restic/fs/file.go +++ b/src/restic/fs/file.go @@ -28,11 +28,17 @@ func fixpath(name string) string { abspath, err := filepath.Abs(name) if err == nil { // Check if \\?\UNC\ already exist - if strings.HasPrefix(abspath, "\\\\?\\UNC\\") { return abspath } + if strings.HasPrefix(abspath, "\\\\?\\UNC\\") { + return abspath + } // Check if \\?\ already exist - if strings.HasPrefix(abspath, "\\\\?\\") { return abspath } + if strings.HasPrefix(abspath, "\\\\?\\") { + return abspath + } // Check if path starts with \\ - if strings.HasPrefix(abspath, "\\\\") { return strings.Replace(abspath, "\\\\", "\\\\?\\UNC\\", 1) } + if strings.HasPrefix(abspath, "\\\\") { + return strings.Replace(abspath, "\\\\", "\\\\?\\UNC\\", 1) + } // Normal path return "\\\\?\\" + abspath }