~sircmpwn/gmni

861d2e2cbffb52cb9cf3efcb5716b041fdfcab91 — OndÅ™ej Fiala 2 years ago bf7975d
gmnlm: don't assume everything starting with b/f is b/f command

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'.
1 files changed, 8 insertions(+), 2 deletions(-)

M src/gmnlm.c
M src/gmnlm.c => src/gmnlm.c +8 -2
@@ 569,8 569,11 @@ 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);
			if (endptr[0]) break;
		} else if (in[1]) {
			break;
		}
		while (historyhops > 0) {
			if (browser->history->prev) {


@@ 582,8 585,11 @@ 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);
			if (endptr[0]) break;
		} else if (in[1]) {
			break;
		}
		while (historyhops > 0) {
			if (browser->history->next) {