diff options
author | Ian Moffett <ian@osmora.org> | 2024-05-23 02:42:58 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-05-23 03:18:41 -0400 |
commit | a6b64a1d8c6cdadece333edfcb0589d0711b5a58 (patch) | |
tree | 06120fcaa862b13d1be778b89c3965dd8fc6452e | |
parent | 05eb9f648569d708e167272e04437466a2f0b594 (diff) |
init: mshell: Handle empty commands
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | usr.sbin/init/mshell.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/init/mshell.c b/usr.sbin/init/mshell.c index 78c3a82..dde07a9 100644 --- a/usr.sbin/init/mshell.c +++ b/usr.sbin/init/mshell.c @@ -77,6 +77,10 @@ parse_input(struct mshell_state *state) cmd[cmd_idx] = '\0'; + /* Ignore empty commands */ + if (cmd_idx == 0) + return; + if (strcmp(cmd, "reboot") == 0) { reboot(REBOOT_DEFAULT); } else if (strcmp(cmd, "pagesize") == 0) { |