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.
This commit is contained in:
Philippe Schommers 2014-03-04 18:48:03 +01:00
parent 2d0600de38
commit d06204959e
1 changed files with 4 additions and 0 deletions

View File

@ -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.")
}