aboutsummaryrefslogtreecommitdiff
path: root/common/fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/fs.cpp')
-rw-r--r--common/fs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/fs.cpp b/common/fs.cpp
index 62ab59f96e..b65d03a690 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -322,6 +322,19 @@ int FSDirectory::listMatchingMembers(ArchiveMemberList &list, const String &patt
matches++;
}
}
+
+ // If non-flat directory was created, include directories in the match too
+ if (!_flat) {
+ it = _subDirCache.begin();
+ for ( ; it != _subDirCache.end(); ++it) {
+ if (it->_key.matchString(lowercasePattern, false, true)) {
+ list.push_back(ArchiveMemberPtr(new FSNode(it->_key + "/")));
+
+ matches++;
+ }
+ }
+ }
+
return matches;
}
@@ -342,6 +355,15 @@ int FSDirectory::listMembers(ArchiveMemberList &list) {
++files;
}
+ // If non-flat directory was created, include directories in the list too
+ if (!_flat) {
+ for (NodeCache::iterator it = _subDirCache.begin(); it != _subDirCache.end(); ++it) {
+ list.push_back(ArchiveMemberPtr(new FSNode(it->_key + "/")));
+
+ ++files;
+ }
+ }
+
return files;
}