1
0
mirror of https://git.sr.ht/~sircmpwn/gmni synced 2024-11-23 04:51:59 +01:00

gmnlm: return to previous page on empty input

This commit is contained in:
Eyal Sawady 2020-09-24 14:28:24 -04:00 committed by Drew DeVault
parent 689fb8b470
commit b050b9e467

@ -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) {