~sircmpwn/visurf-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH v2] nsvi: load nsvirc

Details
Message ID
<20210914162240.1358-1-ecs@d2evs.net>
DKIM signature
pass
Download raw message
Patch: +24 -0
---
v1 -> v2: don't drop TODO for loading bindings
 frontends/visurf/main.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/frontends/visurf/main.c b/frontends/visurf/main.c
index 03feded9e..f1056eec0 100644
--- a/frontends/visurf/main.c
+++ b/frontends/visurf/main.c
@@ -781,6 +781,28 @@ nsvi_init_bindings(struct nsvi_state *state, struct nsvi_bindings *bindings)
	nsvi_bindings_new(bindings, "<Prior>", "scroll 100%+");
}

static void
nsvi_load_config(struct nsvi_state *state)
{
	assert(config_home != NULL);
	char *config = NULL;
	netsurf_mkpath(&config, NULL, 2, config_home, "nsvirc");
	if (config == NULL) {
		return;
	}
	FILE *f = fopen(config, "r");
	if (f == NULL)  {
		return;
	}
	char *line = NULL;
	size_t len = 0;
	while (getline(&line, &len, f) != -1) {
		nsvi_command(state, line);
	}
	free(line);
	fclose(f);
}

int
main(int argc, char *argv[]) {
	struct nsvi_state state = {0};
@@ -868,6 +890,8 @@ main(int argc, char *argv[]) {
		fatal("browser_window_create failed");
	}

	nsvi_load_config(&state);

	while (!state.quit) {
		if (wl_display_flush(state.wl_display) == -1 && errno != EAGAIN) {
			break;
-- 
2.33.0
Details
Message ID
<CE9QWKLFVAU1.2YNDE2901UFWJ@taiga>
In-Reply-To
<20210914162240.1358-1-ecs@d2evs.net> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   45a0ee63d..ac9392f74  master -> master
Reply to thread Export thread (mbox)