lib/model: Handle filename conflicts on Windows.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3810
LGTM: calmh
This commit is contained in:
Unrud authored and Audrius Butkevicius committed 2016-12-22 23:04:53 +00:00
1 parent bab7c8ebbf
commit 01e50eb3fa
6 files changed
+222 -1

No files matched your search

+8
View File
@@ -130,6 +130,14 @@ func (w *walker) walk() (chan protocol.FileInfo, error) {
filepath.Walk(w.Dir, hashFiles)
} else {
for _, sub := range w.Subs {
if !osutil.IsDir(w.Dir, filepath.Dir(sub)) {
l.Infoln("Skipping sub path that is not in a directory", w.Dir, sub)
continue
}
if !osutil.CheckNameConflict(w.Dir, sub) {
l.Infoln("Skipping sub path that collides", w.Dir, sub)
continue
}
filepath.Walk(filepath.Join(w.Dir, sub), hashFiles)
}
}