~sircmpwn/gmni-devel

gmnlm: output newline when quiting via Control-D v2 APPLIED

Ondřej Fiala: 1
 gmnlm: output newline when quiting via Control-D

 1 files changed, 1 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/gmni-devel/patches/28097/mbox | git am -3
Learn more about email & git

[PATCH v2] gmnlm: output newline when quiting via Control-D Export this patch

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
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   0796563..5f4c617  master -> master