Skip to content

Commit

Permalink
always ignore a set of variables
Browse files Browse the repository at this point in the history
Currently these variables are only ignored for a specific case
but it makes sense to retain that in the general case too.
  • Loading branch information
drahnr committed Mar 17, 2023
1 parent 1d66895 commit bc87a31
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,19 @@ pub fn try_parse() -> Result<Command> {
// If we're running under rr, avoid the `LD_PRELOAD` bits, as it will
// almost surely do the wrong thing, as the compiler gets executed
// in a different process tree.
//
// FIXME: Maybe we should strip out `LD_PRELOAD` always?
if env::var_os("RUNNING_UNDER_RR").is_some() {
env_vars.retain(|(k, _v)| {
k != "LD_PRELOAD"
&& k != "RUNNING_UNDER_RR"
&& k != "HOSTNAME"
&& k != "PWD"
&& k != "HOST"
&& k != "RPM_BUILD_ROOT"
&& k != "SOURCE_DATE_EPOCH"
&& k != "RPM_PACKAGE_RELEASE"
&& k != "MINICOM"
&& k != "DESTDIR"
&& k != "RPM_PACKAGE_VERSION"
});
}
env_vars.retain(|(k, _v)| {
k != "LD_PRELOAD"
&& k != "RUNNING_UNDER_RR"
&& k != "HOSTNAME"
&& k != "PWD"
&& k != "HOST"
&& k != "RPM_BUILD_ROOT"
&& k != "SOURCE_DATE_EPOCH"
&& k != "RPM_PACKAGE_RELEASE"
&& k != "MINICOM"
&& k != "DESTDIR"
&& k != "RPM_PACKAGE_VERSION"
});

let cmd = matches
.get_many("CMD")
Expand Down

0 comments on commit bc87a31

Please sign in to comment.