From 1d4c98b3c04b240c56dd40c2a260126dd166d2d5 Mon Sep 17 00:00:00 2001 From: Pin Date: Wed, 30 Mar 2022 20:09:29 -0400 Subject: [PATCH] minor changed --- msh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/msh.c b/msh.c index 7b8de98..c2be6ea 100644 --- a/msh.c +++ b/msh.c @@ -116,7 +116,7 @@ char *getPrompt() { union pipe input, output; FILE *outputFileD; size_t len = 0; - int status; + int status = 0; static char *prompt = NULL; static size_t promptCap = 0; @@ -152,7 +152,10 @@ char *getPrompt() { do { waitpid(pid, &status, WUNTRACED); } while(!WIFEXITED(status) && !WIFSIGNALED(status)); - printf("Status: %d\n", status); + } + + if (status != 0) { + prompt = ">> "; } return prompt;