commit 7f8b1dfb2f5b39f125f10e3b1c336c909710c84b
parent 5aa7f1ad704b48eb3843de3f071cd9ad179f3df2
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Sat, 29 Apr 2023 19:08:38 -0400
step: handle ctrl+D.
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/mumble b/mumble
Binary files differ.
diff --git a/src/mumble.c b/src/mumble.c
@@ -8,10 +8,12 @@ int main(int argc, char** argv)
puts("Press Ctrl+C to exit\n");
int loop = 1;
while (loop) {
- fputs("mumble>", stdout);
+ fputs("mumble> ", stdout);
void* catcher = fgets(input, 2048, stdin);
if (catcher == NULL) {
+ // ^ catches Ctrl+D
loop = 0;
+ puts("");
} else {
printf("You said: %s", input);
}