mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
Add trailing folder seperator to allow symlinks as folder path (fixes #1361)
This commit is contained in:
parent
c1c41242bb
commit
054bc970e2
@ -363,6 +363,9 @@ 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 {
|
||||||
|
folder.RawPath = folder.RawPath + string(filepath.Separator)
|
||||||
|
}
|
||||||
|
|
||||||
if folder.ID == "" {
|
if folder.ID == "" {
|
||||||
folder.ID = "default"
|
folder.ID = "default"
|
||||||
|
@ -91,7 +91,7 @@ func TestDeviceConfig(t *testing.T) {
|
|||||||
expectedFolders := []FolderConfiguration{
|
expectedFolders := []FolderConfiguration{
|
||||||
{
|
{
|
||||||
ID: "test",
|
ID: "test",
|
||||||
RawPath: "testdata",
|
RawPath: "testdata" + string(filepath.Separator),
|
||||||
Devices: []FolderDeviceConfiguration{{DeviceID: device1}, {DeviceID: device4}},
|
Devices: []FolderDeviceConfiguration{{DeviceID: device1}, {DeviceID: device4}},
|
||||||
ReadOnly: true,
|
ReadOnly: true,
|
||||||
RescanIntervalS: 600,
|
RescanIntervalS: 600,
|
||||||
@ -326,7 +326,7 @@ func TestIssue1262(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
actual := cfg.Folders()["test"].RawPath
|
actual := cfg.Folders()["test"].RawPath
|
||||||
expected := "e:"
|
expected := "e:/"
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
expected = `e:\`
|
expected = `e:\`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user