File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change @@ -45,27 +45,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
45
45
TRY (as_user.login ());
46
46
47
47
TRY (Core::System::pledge (" stdio rpath exec" ));
48
-
49
- Vector<StringView> exec_environment;
50
- for (size_t i = 0 ; environ[i]; ++i) {
51
- StringView env_view { environ[i], strlen (environ[i]) };
52
- auto maybe_needle = env_view.find (' =' );
53
-
54
- if (!maybe_needle.has_value ())
55
- continue ;
56
-
57
- // FIXME: Allow a custom selection of variables once ArgsParser supports options with optional parameters.
58
- if (!preserve_env && env_view.substring_view (0 , maybe_needle.value ()) != " TERM" sv)
59
- continue ;
60
-
61
- exec_environment.append (env_view);
62
- }
63
-
64
- Vector<String> exec_arguments;
65
- exec_arguments.ensure_capacity (command.size ());
66
- for (auto const & it : command)
67
- exec_arguments.append (it.to_string ());
68
-
69
- TRY (Core::System::exec (command.at (0 ), command, Core::System::SearchInPath::Yes, exec_environment));
48
+ TRY (Core::System::exec_command (command, preserve_env));
70
49
return 0 ;
71
50
}
You can’t perform that action at this time.
0 commit comments