step: handle ctrl+D.

This commit is contained in:
NunoSempere 2023-04-29 19:08:38 -04:00
parent 5aa7f1ad70
commit 7f8b1dfb2f
2 changed files with 3 additions and 1 deletions

BIN
mumble Executable file

Binary file not shown.

View File

@ -11,7 +11,9 @@ int main(int argc, char** argv)
fputs("mumble> ", stdout); fputs("mumble> ", stdout);
void* catcher = fgets(input, 2048, stdin); void* catcher = fgets(input, 2048, stdin);
if (catcher == NULL) { if (catcher == NULL) {
// ^ catches Ctrl+D
loop = 0; loop = 0;
puts("");
} else { } else {
printf("You said: %s", input); printf("You said: %s", input);
} }