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;