Merge pull request #134 from liubin/master

should ignore  invalid a key-value pair as an env
This commit is contained in:
Yang Bo 2020-02-10 11:14:36 +08:00 committed by GitHub
commit e2c9426ebf

View File

@ -683,9 +683,10 @@ fn do_exec(logger: &Logger, path: &str, args: &[String], env: &[String]) -> Resu
}
for e in env.iter() {
let v: Vec<&str> = e.split("=").collect();
let v: Vec<&str> = e.splitn(2, "=").collect();
if v.len() != 2 {
info!(logger, "incorrect env config!");
continue;
}
env::set_var(v[0], v[1]);
}