From 7c844ec5e06076e40da12685488406a3a58dfb65 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 14 Oct 2025 10:13:32 -0400 Subject: cmd: hush: Ignore input if buffer is empty Do not try to test the input against anything if there is no input to test against. Signed-off-by: Ian Moffett --- src/cmd/hush/hush.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/hush/hush.c b/src/cmd/hush/hush.c index 9bd248f..f8e2572 100644 --- a/src/cmd/hush/hush.c +++ b/src/cmd/hush/hush.c @@ -109,6 +109,10 @@ main(void) read_input(buf, sizeof(buf)); write(STDOUT_FILENO, "\n", 1); + if (buf[0] == '\0') { + continue; + } + snprintf(binpath, sizeof(binpath), "/usr/bin/%s", buf); if ((pid = spawn(argv[0], argv)) < 0) { printf("unknown command \"%s\"\n", buf); -- cgit v1.2.3