Fix the trie building omitting the drive at the root

This commit is contained in:
Paul Fd 2023-09-24 23:28:41 +02:00 committed by Paul Ferrand
parent c87b4ecc33
commit 2d0cee4be8

View file

@ -97,6 +97,10 @@ size_t FileTrieBuilder::ensureDirectory(const fs::path& dirPath)
fs::path parentPath = dirPath.parent_path(); fs::path parentPath = dirPath.parent_path();
if (parentPath != dirPath) if (parentPath != dirPath)
ent.parent = ensureDirectory(parentPath); ent.parent = ensureDirectory(parentPath);
else
// On Windows, (--dirPath.end()) would be `\\` but `parent_path` and `dirPath`
// would both be `C:\\` so we update the name to match.
ent.name = dirPath.u8string();
} }
size_t dirIndex = trie.entries_.size(); size_t dirIndex = trie.entries_.size();