It is common practice to quit programs reading from stdin by sending
EOF to their input. This commit ensures such an exit is functionally
equivalent to a regular exit via the 'q' command.
---
Apologies, forgot to properly verify it works. This should do.
src/gmnlm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gmnlm.c b/src/gmnlm.c
index b30d602..536914a 100644
--- a/src/gmnlm.c+++ b/src/gmnlm.c
@@ -553,6 +553,7 @@ do_prompts(const char *prompt, struct browser *browser)
char *in = NULL;
ssize_t n = getline(&in, &l, browser->tty);
if (n == -1 && feof(browser->tty)) {
+ fputc('\n', browser->tty); result = PROMPT_QUIT;
goto exit;
}
--
2.34.1