Pass the environment as a const reference so nobody else is tempted to modify it

This commit is contained in:
Cameron Gutman
2023-08-14 19:36:02 -05:00
parent 774f13aecb
commit 22ab9948fa
4 changed files with 4 additions and 4 deletions

View File

@@ -157,7 +157,7 @@ namespace platf {
}
bp::child
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
if (!group) {
if (!file) {
return bp::child(cmd, env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);