Utilities: Remove redundant program name element in Core::command() call

This removes a redundant program name element from the arguments Vector
in calls to Core::command().

The Shell's argument parsing logic tolerated the extra argument,
until 83609ad.
This commit is contained in:
Itamar 2022-03-16 22:03:23 +02:00 committed by Ali Mohammad Pur
parent 45788d030a
commit 09bdd844b4
Notes: sideshowbarker 2024-07-17 17:15:55 +09:00

View file

@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
continue;
auto ast_full_path = cpp_full_path.replace(".cpp", ".ast");
outln("{}", cpp_full_path);
auto res = Core::command("/bin/sh", { "sh", "-c", String::formatted("cpp-parser {} > {}", cpp_full_path, ast_full_path) }, {});
auto res = Core::command("/bin/sh", { "-c", String::formatted("cpp-parser {} > {}", cpp_full_path, ast_full_path) }, {});
VERIFY(!res.is_error());
}
@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
continue;
auto ast_full_path = cpp_full_path.replace(".cpp", ".txt");
outln("{}", cpp_full_path);
auto res = Core::command("/bin/sh", { "sh", "-c", String::formatted("cpp-preprocessor {} > {}", cpp_full_path, ast_full_path) }, {});
auto res = Core::command("/bin/sh", { "-c", String::formatted("cpp-preprocessor {} > {}", cpp_full_path, ast_full_path) }, {});
VERIFY(!res.is_error());
}