Compare commits
No commits in common. "6b4d41529edd166886abe1f1d4c5410b9ea79737" and "8bcec00a9d8e736479b0f328711512ffb7de1cf5" have entirely different histories.
6b4d41529e
...
8bcec00a9d
@ -23,8 +23,6 @@ static Result<Vector<String>> split_command_into_args(StringView cmd)
|
|||||||
|
|
||||||
static Result<void> execute_command(StringView command)
|
static Result<void> execute_command(StringView command)
|
||||||
{
|
{
|
||||||
if (strcspn(command.chars(), " #") == 0) return {};
|
|
||||||
|
|
||||||
auto args = TRY(split_command_into_args(command));
|
auto args = TRY(split_command_into_args(command));
|
||||||
if (args.size() < 1) exit(0);
|
if (args.size() < 1) exit(0);
|
||||||
|
|
||||||
@ -96,8 +94,6 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
|
|
||||||
if (strspn(cmd.chars(), " \n") == cmd.length()) continue;
|
if (strspn(cmd.chars(), " \n") == cmd.length()) continue;
|
||||||
|
|
||||||
if (strcspn(cmd.chars(), " #") == 0) continue;
|
|
||||||
|
|
||||||
if (!strncmp(cmd.chars(), "cd", 2))
|
if (!strncmp(cmd.chars(), "cd", 2))
|
||||||
{
|
{
|
||||||
auto args = TRY(split_command_into_args(cmd.view()));
|
auto args = TRY(split_command_into_args(cmd.view()));
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mkdir -p /tmp
|
mkdir -p /tmp
|
||||||
mount -t tmpfs /tmp
|
mount -t tmpfs /tmp
|
||||||
chmod 1777 /tmp
|
chmod 1777 /tmp
|
||||||
|
@ -42,8 +42,7 @@ 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")));
|
||||||
TRY(shell_argv.try_append(file.mutable_data()));
|
char* const* arg = argv;
|
||||||
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