mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Don't filter out empty environment variables
This check was only needed because `operator[]` inserts an empty entry if the variable doesn't exist. Wine also complains when `WINEPREFIX` is empty, so we should probably not try to have our own behavior here.
This commit is contained in:
@@ -42,10 +42,10 @@ constexpr char temp_dir_override_env_var[] = "YABRIDGE_TEMP_DIR";
|
||||
fs::path get_temporary_directory() {
|
||||
const bp::environment env = boost::this_process::environment();
|
||||
if (const auto directory = env.find(temp_dir_override_env_var);
|
||||
directory != env.end() && !directory->empty()) {
|
||||
directory != env.end()) {
|
||||
return directory->to_string();
|
||||
} else if (const auto directory = env.find("XDG_RUNTIME_DIR");
|
||||
directory != env.end() && !directory->empty()) {
|
||||
directory != env.end()) {
|
||||
return directory->to_string();
|
||||
} else {
|
||||
return fs::temp_directory_path();
|
||||
|
||||
@@ -257,8 +257,7 @@ fs::path normalize_plugin_path(const fs::path& windows_library_path,
|
||||
std::variant<OverridenWinePrefix, fs::path, DefaultWinePrefix> find_wine_prefix(
|
||||
fs::path windows_plugin_path) {
|
||||
const bp::environment env = boost::this_process::environment();
|
||||
if (const auto prefix = env.find("WINEPREFIX");
|
||||
prefix != env.end() && !prefix->empty()) {
|
||||
if (const auto prefix = env.find("WINEPREFIX"); prefix != env.end()) {
|
||||
return OverridenWinePrefix{prefix->to_string()};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user