Fixed enumeration of files.
This commit is contained in:
parent
7aa1edcea0
commit
3b7396c4d6
@ -63,7 +63,16 @@ fs::path RelativeFileSystemAdapter<TWrapped>::getHomeFolder()
|
||||
template<typename TWrapped>
|
||||
std::vector<FileInfo> RelativeFileSystemAdapter<TWrapped>::listFiles(const fs::path& folder)
|
||||
{
|
||||
std::vector<FileInfo> result = wrapped_.listFiles(root_ / folder);
|
||||
std::vector<FileInfo> result;
|
||||
fs::path combinedPath = root_;
|
||||
if (folder.is_absolute()) {
|
||||
combinedPath += folder;
|
||||
}
|
||||
else {
|
||||
combinedPath /= folder;
|
||||
}
|
||||
|
||||
result = wrapped_.listFiles(combinedPath);
|
||||
for (FileInfo& fileInfo : result) {
|
||||
fileInfo.path = "/" / fileInfo.path.lexically_relative(root_);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ std::vector<FileInfo> StackedFileSystemAdapter::listFiles(const fs::path& folder
|
||||
{
|
||||
return existing.path == file.path;
|
||||
});
|
||||
if (it != files.end()) {
|
||||
if (it == files.end()) {
|
||||
files.push_back(file);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user