cgmnlm

colorful gemini line mode browser
git clone https://git.clttr.info/cgmnlm.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 963700d8d6e31aecfc14e12184637f4c3360f6ed
parent 5ad3f0aaccbcf328756d0eaad0e98068587395d1
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Thu, 24 Sep 2020 14:56:46 -0400

gmnlm: p: require whitespace before link number

In order to allow users to navigate to relative URLs starting with 'p'.

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

diff --git a/src/gmnlm.c b/src/gmnlm.c @@ -69,7 +69,7 @@ const char *help_msg = "The following commands are available:\n\n" "q\tQuit\n" "N\tFollow Nth link (where N is a number)\n" - "p[N]\tShow URL of Nth link (where N is a number)\n" + "p N\tShow URL of Nth link (where N is a number)\n" "b\tBack (in the page history)\n" "f\tForward (in the page history)\n" "H\tView all page history\n" @@ -303,7 +303,7 @@ do_prompts(const char *prompt, struct browser *browser) goto exit; } case 'p': - if (!in[1]) break; + if (!isspace(in[1])) break; struct link *link = browser->links; char *endptr; int linksel = (int)strtol(in+1, &endptr, 10);