diff --git a/cmd/shell.c b/cmd/shell.c index 43c5675..a08cbfb 100644 --- a/cmd/shell.c +++ b/cmd/shell.c @@ -15,6 +15,11 @@ int main() { do { cmd = read_input(); + // CTRL+D will set cmd to null + // Shell should exit if encountered + if (cmd == NULL) { + exit(EXIT_FAILURE); + } args = split_cmd(cmd); status_return = reverse_execute(args);