2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-16 10:05:25 +00:00

structured file with gofmt

This commit is contained in:
Daniel Örn 2016-10-05 07:30:46 +02:00
parent 5c7325f44a
commit 84421a7c68

View File

@ -28,11 +28,17 @@ func fixpath(name string) string {
abspath, err := filepath.Abs(name) abspath, err := filepath.Abs(name)
if err == nil { if err == nil {
// Check if \\?\UNC\ already exist // Check if \\?\UNC\ already exist
if strings.HasPrefix(abspath, "\\\\?\\UNC\\") { return abspath } if strings.HasPrefix(abspath, "\\\\?\\UNC\\") {
return abspath
}
// Check if \\?\ already exist // Check if \\?\ already exist
if strings.HasPrefix(abspath, "\\\\?\\") { return abspath } if strings.HasPrefix(abspath, "\\\\?\\") {
return abspath
}
// Check if path starts with \\ // 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 // Normal path
return "\\\\?\\" + abspath return "\\\\?\\" + abspath
} }