mirror of
https://github.com/decompals/wibo.git
synced 2025-10-15 14:45:12 +00:00
Use WIBO_PATH, WINEPATH to resolve executables as well
This commit is contained in:
parent
ff04eb9f41
commit
086e08d93f
@ -292,10 +292,15 @@ static std::vector<std::filesystem::path> buildSearchDirectories() {
|
||||
dirs.push_back(wibo::guestExecutablePath.parent_path());
|
||||
}
|
||||
dirs.push_back(std::filesystem::current_path());
|
||||
if (const char *envPath = std::getenv("PATH")) {
|
||||
auto parsed = parseHostPath(envPath);
|
||||
dirs.insert(dirs.end(), parsed.begin(), parsed.end());
|
||||
}
|
||||
const auto addFromEnv = [&](const char *envVar) {
|
||||
if (const char *envPath = std::getenv(envVar)) {
|
||||
auto parsed = parseHostPath(envPath);
|
||||
dirs.insert(dirs.end(), parsed.begin(), parsed.end());
|
||||
}
|
||||
};
|
||||
addFromEnv("WIBO_PATH");
|
||||
addFromEnv("WINEPATH"); // Wine compatibility
|
||||
addFromEnv("PATH");
|
||||
return dirs;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user