minor changed

This commit is contained in:
Pin
2022-03-30 20:09:29 -04:00
parent c9b6414f78
commit 1d4c98b3c0

7
msh.c
View File

@@ -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;