diff --git a/src/gmnlm.c b/src/gmnlm.c

index b7cc12dbbb391dd3e72e5e30d21a7e7957872f60..5cc2e18a06dc99f2258d6bfc875c2c01ceb265c2 100644

--- a/src/gmnlm.c

+++ b/src/gmnlm.c

@@ -3,6 +3,7 @@ #include <ctype.h>

#include <getopt.h>

#include <openssl/bio.h>

#include <openssl/err.h>

+#include <regex.h>

#include <stdbool.h>

#include <stdio.h>

#include <string.h>

@@ -32,6 +33,9 @@ struct Curl_URL *url;

struct link *links;

struct history *history;

bool running;

};

enum prompt_result {

@@ -39,14 +43,20 @@ PROMPT_AGAIN,

PROMPT_MORE,

PROMPT_QUIT,

PROMPT_ANSWERED,

};

const char *help_msg =

"The following commands are available:\n\n"

;

static void

@@ -100,20 +110,17 @@ if (n == -1 && feof(browser->tty)) {

	result = PROMPT_QUIT;

	goto exit;

}

	result = PROMPT_MORE;

	goto exit;

	result = PROMPT_QUIT;

	goto exit;

	if (!browser->history->prev) {

		fprintf(stderr, "At beginning of history\n");

		result = PROMPT_AGAIN;

@@ -123,8 +130,7 @@ browser->history = browser->history->prev;

	set_url(browser, browser->history->url, NULL);

	result = PROMPT_ANSWERED;

	goto exit;

	if (!browser->history->next) {

		fprintf(stderr, "At end of history\n");

		result = PROMPT_AGAIN;

@@ -134,6 +140,25 @@ browser->history = browser->history->next;

	set_url(browser, browser->history->url, NULL);

	result = PROMPT_ANSWERED;

	goto exit;

}

struct link *link = browser->links;

@@ -154,10 +179,14 @@ goto exit;

	}

}

set_url(browser, in, &browser->history);

result = PROMPT_ANSWERED;

exit:

+exit_re:

free(in);

return result;

}

@@ -219,27 +248,34 @@

struct winsize ws;

ioctl(fileno(browser->tty), TIOCGWINSZ, &ws);

char *text = NULL;

int row = 0, col = 0;

struct gemini_token tok;

struct link **next = &browser->links;

while (text != NULL || gemini_parser_next(&p, &tok) == 0) {

+repeat:

	switch (tok.token) {

	case GEMINI_TEXT:

		if (text == NULL) {

			text = tok.text;

		}

		break;

	case GEMINI_LINK:

		if (text == NULL) {

			text = trim_ws(tok.link.text ? tok.link.text : tok.link.url);

			*next = calloc(1, sizeof(struct link));

			(*next)->url = strdup(trim_ws(tok.link.url));

			next = &(*next)->next;

		} else {

		}

		break;

	case GEMINI_PREFORMATTED:

@@ -247,44 +283,59 @@ continue; // TODO

	case GEMINI_HEADING:

		if (text == NULL) {

			for (int n = tok.heading.level; n; --n) {

			}

			switch (tok.heading.level) {

			case 1:

				break;

			case 2:

			case 3:

				break;

			}

			text = trim_ws(tok.heading.title);

		} else {

		}

		break;

	case GEMINI_LIST_ITEM:

		if (text == NULL) {

				browser->unicode ? "•" : "*");

			text = trim_ws(tok.list_item);

		} else {

		}

		break;

	case GEMINI_QUOTE:

		if (text == NULL) {

				browser->unicode ? "|" : "|");

			text = trim_ws(tok.quote_text);

		} else {

		}

		break;

	}

	if (text) {

		text += w;

		if (text[0] && row < ws.ws_row - 4) {

			continue;

@@ -304,8 +355,9 @@

	if (browser->pagination && row >= ws.ws_row - 4) {

		char prompt[4096];

		snprintf(prompt, sizeof(prompt), "\n%s at %s\n"

			"(more) => ", resp->meta, browser->plain_url,

			browser->history->prev ? "[b]ack; " : "",

			browser->history->next ? "[f]orward; " : "");

		enum prompt_result result = PROMPT_AGAIN;

@@ -322,6 +374,10 @@ browser->running = false;

			return true;

		case PROMPT_ANSWERED:

			return true;

		}

		row = col = 0;

@@ -533,6 +589,7 @@ case PROMPT_QUIT:

		browser.running = false;

		break;

	case PROMPT_ANSWERED:

		break;

	}

Proxy Information
Original URL
gemini://gmn.clttr.info:1965/sources/cgmnlm.git/commits/f4a4be2513580809c01212a08a5284f9cf16ad5f.patch
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
146.79429 milliseconds
Gemini-to-HTML Time
2.57448 milliseconds

This content has been proxied by September (ba2dc).