cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit b050b9e467589561b1203f99e9f58c990c824b1a
parent 689fb8b470f19fb83ee1e32efe64b42d6961630c
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Thu, 24 Sep 2020 14:28:24 -0400

gmnlm: return to previous page on empty input

Diffstat:
Msrc/gmnlm.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c @@ -696,11 +696,19 @@ do_requests(struct browser *browser, struct gemini_response *resp) requesting = false; break; } + if (input[0] == '\0' && browser->history->prev) { + free(input); + browser->history = browser->history->prev; + set_url(browser, browser->history->url, NULL); + break; + } char *new_url = gemini_input_url( browser->plain_url, input); + free(input); assert(new_url); set_url(browser, new_url, NULL); + free(new_url); break; case GEMINI_STATUS_CLASS_REDIRECT: if (++nredir >= 5) {