diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-14 10:13:32 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-14 10:13:32 -0400 |
commit | 7c844ec5e06076e40da12685488406a3a58dfb65 (patch) | |
tree | 6b3017bd723e8a45e1c895b939e56df1075adbea | |
parent | 49467fee7899da041c25c07c55ac4bf339fd29d0 (diff) |
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 <ian@osmora.org>
-rw-r--r-- | src/cmd/hush/hush.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |