aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-23 02:42:58 -0400
committerIan Moffett <ian@osmora.org>2024-05-23 03:18:41 -0400
commita6b64a1d8c6cdadece333edfcb0589d0711b5a58 (patch)
tree06120fcaa862b13d1be778b89c3965dd8fc6452e
parent05eb9f648569d708e167272e04437466a2f0b594 (diff)
init: mshell: Handle empty commands
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--usr.sbin/init/mshell.c4
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) {