From 2d0cee4be8fe6551d285a686f16337f12ead3f9e Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Sun, 24 Sep 2023 23:28:41 +0200 Subject: [PATCH] Fix the trie building omitting the drive at the root --- plugins/common/plugin/FileTrie.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/common/plugin/FileTrie.cpp b/plugins/common/plugin/FileTrie.cpp index 014ad62..31c77a0 100644 --- a/plugins/common/plugin/FileTrie.cpp +++ b/plugins/common/plugin/FileTrie.cpp @@ -97,6 +97,10 @@ size_t FileTrieBuilder::ensureDirectory(const fs::path& dirPath) fs::path parentPath = dirPath.parent_path(); if (parentPath != dirPath) 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();