From e2eb9a92cb24b166ec27a84af434364ae4cc2410 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 24 Mar 2023 00:51:42 +0100 Subject: [PATCH] sh: Don't do anything if Enter is pressed with no command --- apps/sh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/sh.c b/apps/sh.c index 9f32b054..1b689f37 100644 --- a/apps/sh.c +++ b/apps/sh.c @@ -90,6 +90,7 @@ int main() if (child == 0) { char** argv = split_command_into_argv(command); + if (argv[0] == NULL) return 0; sh_execvp(argv); perror(argv[0]); return 1;