diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 290ba719c..3dcfce8cd 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -344,7 +344,13 @@ func main() { if options.confDir != "" { // Not set as default above because the string can be really long. - baseDirs["config"] = options.confDir + if !filepath.IsAbs(options.confDir) { + path, err := filepath.Abs(options.confDir) + if err != nil { + l.Fatalln(err) + } + baseDirs["config"] = path + } } if err := expandLocations(); err != nil { diff --git a/lib/model/model.go b/lib/model/model.go index 9d7ab8877..273d3e7d5 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -285,7 +285,8 @@ func (m *Model) warnAboutOverwritingProtectedFiles(folder string) { } // check if file is ignored - if ignores.Match(protectedFilePath).IsIgnored() { + relPath, _ := filepath.Rel(folderLocation, protectedFilePath) + if ignores.Match(relPath).IsIgnored() { continue }