mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-15 13:00:02 +02:00
Preemptively unset WAYLAND_DISPLAY
This commit is contained in:
@@ -174,6 +174,13 @@ void ProcessEnvironment::insert(const std::string& key,
|
||||
variables_.push_back(key + "=" + value);
|
||||
}
|
||||
|
||||
size_t ProcessEnvironment::erase(const std::string& key) {
|
||||
return std::erase_if(variables_, [&key](const std::string& variable) {
|
||||
return variable.starts_with(key) && variable.size() > key.size() &&
|
||||
variable[key.size()] == '=';
|
||||
});
|
||||
}
|
||||
|
||||
char* const* ProcessEnvironment::make_environ() const {
|
||||
recreated_environ_.clear();
|
||||
|
||||
|
||||
@@ -101,6 +101,14 @@ class ProcessEnvironment {
|
||||
*/
|
||||
void insert(const std::string& key, const std::string& value);
|
||||
|
||||
/**
|
||||
* Remove an environment variable from the environment. Returns the number
|
||||
* of elements erased (to stay consistent with the STL map interface). This
|
||||
* can be higher than 1 if the map contains duplicate or overwritten
|
||||
* environment variables.
|
||||
*/
|
||||
size_t erase(const std::string& key);
|
||||
|
||||
/**
|
||||
* Create an environ-like object from the updated environment that can be
|
||||
* passed to the `exec*e()` functions. These pointers will be invalidated
|
||||
|
||||
Reference in New Issue
Block a user