From d7a934cf0e5f567df4ca64f7499b81e405fe7e16 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 22 Oct 2015 11:39:34 +0200 Subject: [PATCH] Paths must not end with slash on Windows --- cmd/syncthing/locations.go | 2 +- cmd/syncthing/main.go | 1 + lib/config/config.go | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/syncthing/locations.go b/cmd/syncthing/locations.go index a7671c23..54c6dd86 100644 --- a/cmd/syncthing/locations.go +++ b/cmd/syncthing/locations.go @@ -54,7 +54,7 @@ var locations = map[locationEnum]string{ locPanicLog: "${config}/panic-${timestamp}.log", locAuditLog: "${config}/audit-${timestamp}.log", locGUIAssets: "${config}/gui", - locDefFolder: "${home}/Sync/", + locDefFolder: "${home}/Sync", } // expandLocations replaces the variables in the location map with actual diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 8f35d3ff..74f1ebba 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -962,6 +962,7 @@ func defaultConfig(myName string) config.Configuration { MinDiskFreePct: 1, Devices: []config.FolderDeviceConfiguration{{DeviceID: myID}}, AutoNormalize: true, + MaxConflicts: -1, }, } newCfg.Devices = []config.DeviceConfiguration{ diff --git a/lib/config/config.go b/lib/config/config.go index 52a42c68..67c6f140 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -425,7 +425,10 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) { // This way in the tests, we get away without OS specific separators // in the test configs. folder.RawPath = filepath.Dir(folder.RawPath + string(filepath.Separator)) - if folder.RawPath[len(folder.RawPath)-1] != filepath.Separator { + + // If we're not on Windows, we want the path to end with a slash to + // penetrate symlinks. On Windows, paths must not end with a slash. + if runtime.GOOS != "windows" && folder.RawPath[len(folder.RawPath)-1] != filepath.Separator { folder.RawPath = folder.RawPath + string(filepath.Separator) }