Deduplicate automation autoload path

Fixes TypesettingTools/Aegisub#168
Fixes arch1t3cht/Aegisub#15
This commit is contained in:
arch1t3cht 2023-01-26 20:52:20 +01:00
parent 15cca59679
commit 642251b2dd

View file

@ -322,7 +322,8 @@ namespace Automation4 {
std::vector<std::future<std::unique_ptr<Script>>> script_futures; std::vector<std::future<std::unique_ptr<Script>>> script_futures;
for (auto tok : agi::Split(path, '|')) { auto path_it = agi::Split(path, '|');
for (auto tok : std::set<agi::StringRange>(begin(path_it), end(path_it))) {
auto dirname = config::path->Decode(agi::str(tok)); auto dirname = config::path->Decode(agi::str(tok));
if (!agi::fs::DirectoryExists(dirname)) continue; if (!agi::fs::DirectoryExists(dirname)) continue;