aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-16 13:19:21 +0000
committerEugene Sandulenko2010-08-16 13:19:21 +0000
commit535d8e12bddb31127dd784ff4df4eaa2d0a7992b (patch)
treea54d4a84077e4a346ed797c10b1e78b8860af678 /common
parentbfabe2af97a72ac701644538baa661867dafeeec (diff)
downloadscummvm-rg350-535d8e12bddb31127dd784ff4df4eaa2d0a7992b.tar.gz
scummvm-rg350-535d8e12bddb31127dd784ff4df4eaa2d0a7992b.tar.bz2
scummvm-rg350-535d8e12bddb31127dd784ff4df4eaa2d0a7992b.zip
OSYSTEM: Add directories to archive list just as in other variants
svn-id: r52121
Diffstat (limited to 'common')
-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;
}