~sircmpwn/gmni-devel

gmni: gmnlm: don't assume everything starting with b/f is b/f command v1 PROPOSED

Ondřej Fiala: 1
 gmnlm: don't assume everything starting with b/f is b/f command

 1 files changed, 6 insertions(+), 2 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/33426/mbox | git am -3
Learn more about email & git

[PATCH gmni] gmnlm: don't assume everything starting with b/f is b/f command Export this patch

It was impossible to enter a file:// URL because it got interpreted
as a 'f' command without any warning about invalid argument. The same
thing happened with relative addresses beginning with 'b' or 'f'.
---
 src/gmnlm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index 9e7b527..8b1dfb4 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -569,8 +569,10 @@ do_prompts(const char *prompt, struct browser *browser)
		result = PROMPT_QUIT;
		goto exit;
	case 'b':
		if (in[1]) {
		if (in[1] && isdigit(in[1])) {
			historyhops =(int)strtol(in+1, &endptr, 10);
		} else if (in[1]) {
			break;
		}
		while (historyhops > 0) {
			if (browser->history->prev) {
@@ -582,8 +584,10 @@ do_prompts(const char *prompt, struct browser *browser)
		result = PROMPT_ANSWERED;
		goto exit;
	case 'f':
		if (in[1]) {
		if (in[1] && isdigit(in[1])) {
			historyhops =(int)strtol(in+1, &endptr, 10);
		} else if (in[1]) {
			break;
		}
		while (historyhops > 0) {
			if (browser->history->next) {
-- 
2.36.1