lib/db: Fix prefixed walks (fixes #4925) (#4940)

This commit is contained in:
Simon Frei authored and Jakob Borg committed 2018-05-17 09:26:40 +02:00
1 parent 81f9a81c7d
commit d64d954721
5 files changed
+165 -92

No files matched your search

+2 -1
View File
@@ -2403,7 +2403,8 @@ func (m *Model) GlobalDirectoryTree(folder, prefix string, levels int, dirsonly
files.WithPrefixedGlobalTruncated(prefix, func(fi db.FileIntf) bool {
f := fi.(db.FileInfoTruncated)
if f.IsInvalid() || f.IsDeleted() || f.Name == prefix {
// Don't include the prefix itself.
if f.IsInvalid() || f.IsDeleted() || strings.HasPrefix(prefix, f.Name) {
return true
}