From 40447910210e9f822d87f080e24811e66232fd14 Mon Sep 17 00:00:00 2001 From: "Nathan P. Reiner" Date: Fri, 16 Dec 2022 10:53:26 +0100 Subject: fix stupid issue --- smash/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'smash') diff --git a/smash/main.c b/smash/main.c index ca7d4fa..ad28e6d 100644 --- a/smash/main.c +++ b/smash/main.c @@ -2,6 +2,7 @@ #include "../lib/sys/io.h" #include "../lib/cstr/cstr.h" +#include "../lib/sys/dup2.h" #define BUFSIZ 1024 @@ -17,6 +18,8 @@ int main(int argc, char *argv[], char *envp[]) char prompt[] = "$ "; u64 line_length; + + while (1) { write(STDOUT_FD, prompt, cstr_length(prompt)); read(STDIN_FD, buf, 1024); @@ -25,7 +28,7 @@ int main(int argc, char *argv[], char *envp[]) if (line_length == 0) return 0; - if (line_length == 1) { + if (line_length > 1) { buf[line_length - 1] = 0; exec(buf); } -- cgit v1.2.3-70-g09d2