libc: Fix execvp() calling the shell after an ENOEXEC
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6ad7491300
commit
6b4d41529e
@ -42,7 +42,8 @@ static Result<int> try_execvpe(const char* name, char* const* argv, char* const*
|
|||||||
{
|
{
|
||||||
Vector<char*> shell_argv;
|
Vector<char*> shell_argv;
|
||||||
TRY(shell_argv.try_append(const_cast<char*>("sh")));
|
TRY(shell_argv.try_append(const_cast<char*>("sh")));
|
||||||
char* const* arg = argv;
|
TRY(shell_argv.try_append(file.mutable_data()));
|
||||||
|
char* const* arg = argv + 1;
|
||||||
do {
|
do {
|
||||||
TRY(shell_argv.try_append(*arg));
|
TRY(shell_argv.try_append(*arg));
|
||||||
} while (*(arg++));
|
} while (*(arg++));
|
||||||
|
Loading…
Reference in New Issue
Block a user