mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
Paths must not end with slash on Windows
This commit is contained in:
parent
503491392d
commit
d7a934cf0e
@ -54,7 +54,7 @@ var locations = map[locationEnum]string{
|
|||||||
locPanicLog: "${config}/panic-${timestamp}.log",
|
locPanicLog: "${config}/panic-${timestamp}.log",
|
||||||
locAuditLog: "${config}/audit-${timestamp}.log",
|
locAuditLog: "${config}/audit-${timestamp}.log",
|
||||||
locGUIAssets: "${config}/gui",
|
locGUIAssets: "${config}/gui",
|
||||||
locDefFolder: "${home}/Sync/",
|
locDefFolder: "${home}/Sync",
|
||||||
}
|
}
|
||||||
|
|
||||||
// expandLocations replaces the variables in the location map with actual
|
// expandLocations replaces the variables in the location map with actual
|
||||||
|
@ -962,6 +962,7 @@ func defaultConfig(myName string) config.Configuration {
|
|||||||
MinDiskFreePct: 1,
|
MinDiskFreePct: 1,
|
||||||
Devices: []config.FolderDeviceConfiguration{{DeviceID: myID}},
|
Devices: []config.FolderDeviceConfiguration{{DeviceID: myID}},
|
||||||
AutoNormalize: true,
|
AutoNormalize: true,
|
||||||
|
MaxConflicts: -1,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
newCfg.Devices = []config.DeviceConfiguration{
|
newCfg.Devices = []config.DeviceConfiguration{
|
||||||
|
@ -425,7 +425,10 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
|
|||||||
// This way in the tests, we get away without OS specific separators
|
// This way in the tests, we get away without OS specific separators
|
||||||
// in the test configs.
|
// in the test configs.
|
||||||
folder.RawPath = filepath.Dir(folder.RawPath + string(filepath.Separator))
|
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)
|
folder.RawPath = folder.RawPath + string(filepath.Separator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user