mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Shell: Do not try to recreate a command from a list of args in time
Shell already provides a run_command(AST::Command) which can be constructed from a list of arguments, use that instead.
This commit is contained in:
parent
bc3285abb0
commit
16def040af
Notes:
sideshowbarker
2024-07-19 05:09:25 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/16def040af4 Pull-request: https://github.com/SerenityOS/serenity/pull/2542 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bugaevc
@ -654,15 +654,18 @@ int Shell::builtin_time(int argc, const char** argv)
|
||||
if (!parser.parse(argc, const_cast<char**>(argv), false))
|
||||
return 1;
|
||||
|
||||
StringBuilder builder;
|
||||
builder.join(' ', args);
|
||||
AST::Command command;
|
||||
for (auto& arg : args)
|
||||
command.argv.append(arg);
|
||||
|
||||
Core::ElapsedTimer timer;
|
||||
timer.start();
|
||||
// TODO: Exit code
|
||||
run_command(builder.string_view());
|
||||
auto job = run_command(command);
|
||||
if (!job)
|
||||
return 1;
|
||||
block_on_job(job);
|
||||
fprintf(stderr, "Time: %d ms\n", timer.elapsed());
|
||||
return 0;
|
||||
return job->exit_code();
|
||||
}
|
||||
|
||||
int Shell::builtin_umask(int argc, const char** argv)
|
||||
|
Loading…
Reference in New Issue
Block a user