Merge pull request #81 from filoozom/patch-1
Fix isTempName to work on Windows (fixes #80)
This commit is contained in:
commit
04a3db132f
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -39,6 +40,9 @@ func (f File) NewerThan(o File) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isTempName(name string) bool {
|
func isTempName(name string) bool {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
name = filepath.ToSlash(name)
|
||||||
|
}
|
||||||
return strings.HasPrefix(path.Base(name), ".syncthing.")
|
return strings.HasPrefix(path.Base(name), ".syncthing.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user