lib: Introduce fs.IsParent (fixes #5324) (#5326)

This commit is contained in:
Simon Frei
2018-11-22 11:16:45 +01:00
committed by Jakob Borg
parent 513d3bc374
commit 2f9840ddae
6 changed files with 19 additions and 11 deletions

View File

@@ -288,7 +288,7 @@ func (m *Model) warnAboutOverwritingProtectedFiles(folder string) {
var filesAtRisk []string
for _, protectedFilePath := range m.protectedFiles {
// check if file is synced in this folder
if !strings.HasPrefix(protectedFilePath, folderLocation) {
if protectedFilePath != folderLocation && !fs.IsParent(protectedFilePath, folderLocation) {
continue
}