From 5ecb8aafa496e9dfff51378be50eb29858b5465a Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 15 Feb 2023 16:35:40 +0100 Subject: add quote parsing to smash --- smash/prompt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 smash/prompt.c (limited to 'smash/prompt.c') diff --git a/smash/prompt.c b/smash/prompt.c new file mode 100644 index 0000000..3b6b3c2 --- /dev/null +++ b/smash/prompt.c @@ -0,0 +1,22 @@ +#include "prompt.h" + +#include "../lib/sys/execve.h" +#include "../lib/sys/wait4.h" +#include "../lib/sys/fork.h" +#include "../lib/sys/exit.h" +#include "../lib/env/env.h" +#include "../lib/io/io.h" + +void prompt() +{ + int pid = fork(); + + if (pid == 0) { + const char *argv[] = {"/system/config/smash.d/prompt", 0}; + execve(argv[0], argv, getenvp()); + wstd("> "); + exit(0); + } + + wait4(pid, 0, 0, 0); +} -- cgit v1.2.3-70-g09d2