Skip to content

Commit 046a492

Browse files
committed
hack: set vars to the empty string rather than removing them (this still exposes that they were set, though...)
1 parent 6943d0c commit 046a492

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plrustc/plrustc/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ impl Callbacks for PlrustcCallbacks {
5252
fn clear_env() {
5353
let all_var_names = std::env::vars_os()
5454
.map(|(name, _)| name)
55+
.filter(|name| {
56+
let name = name.to_string_lossy().to_lowercase();
57+
!(name.starts_with("rust") || name.starts_with("plrust"))
58+
})
5559
.collect::<Vec<_>>();
5660
for name in all_var_names {
57-
std::env::remove_var(name);
61+
std::env::set_var(name, "");
5862
}
5963
}
6064

0 commit comments

Comments
 (0)