Fix the trie building omitting the drive at the root
This commit is contained in:
parent
c87b4ecc33
commit
2d0cee4be8
1 changed files with 4 additions and 0 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue