From fcb1a98129913d205f1a4cfdef420f4af8489686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20R=C3=B3=C5=BCycki?= Date: Fri, 23 Jan 2015 00:22:30 +0100 Subject: [PATCH] Ensuring path separator at the end of the folder path. (fixes #1262) --- internal/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 52d89087..b796b8e9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -26,6 +26,7 @@ import ( "reflect" "sort" "strconv" + "strings" "github.com/calmh/logger" "github.com/syncthing/protocol" @@ -261,6 +262,10 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) { continue } + if !strings.HasSuffix(folder.Path, string(filepath.Separator)) { + folder.Path += string(filepath.Separator) + } + if folder.ID == "" { folder.ID = "default" }