From d06204959e09e5986fc3f76dfecc7700d90670ab Mon Sep 17 00:00:00 2001 From: Philippe Schommers Date: Tue, 4 Mar 2014 18:48:03 +0100 Subject: [PATCH] Fix isTempName to work on Windows (fixes #80) ```path.Base()``` is for slash-separated paths, whereas Windows uses "\" to separate paths. Just convert the \ to / and it works. --- cmd/syncthing/walk.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/syncthing/walk.go b/cmd/syncthing/walk.go index 3f4c35c57..415c44ba0 100644 --- a/cmd/syncthing/walk.go +++ b/cmd/syncthing/walk.go @@ -8,6 +8,7 @@ import ( "os" "path" "path/filepath" + "runtime" "strings" "time" @@ -39,6 +40,9 @@ func (f File) NewerThan(o File) bool { } func isTempName(name string) bool { + if runtime.GOOS == "windows" { + name = filepath.ToSlash(name) + } return strings.HasPrefix(path.Base(name), ".syncthing.") }