diff options
author | Rummskartoffel <Rummskartoffel@protonmail.com> | 2022-01-20 22:04:57 +0100 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-21 14:45:04 +0200 |
commit | d2f99c200fbebe851d33fb1b990953d7587b1f5d (patch) | |
tree | fcf50d4c85b37b8e04a522b103f841a87d7bc333 | |
parent | 2cda579b076a615e94be6ed922b987aa189b98e4 (diff) | |
download | serenity-d2f99c200fbebe851d33fb1b990953d7587b1f5d.zip |
UserspaceEmulator: Fix execve messing up command lines with "--"
Emulator::virt$execve would construct command lines such as
`/bin/UserspaceEmulator echo -- hello` instead of
`/bin/UserspaceEmulator -- echo hello`, which naturally caused problems.
This commit moves the "--" to the correct place.
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp index ed29cbd10d..6b43e9ce45 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp @@ -1229,10 +1229,10 @@ int Emulator::virt$execve(FlatPtr params_addr) Vector<char*> envp; argv.append(const_cast<char*>("/bin/UserspaceEmulator")); - argv.append(const_cast<char*>(path.characters())); if (g_report_to_debug) argv.append(const_cast<char*>("--report-to-debug")); argv.append(const_cast<char*>("--")); + argv.append(const_cast<char*>(path.characters())); auto create_string_vector = [](auto& output_vector, auto& input_vector) { for (auto& string : input_vector) |