~sircmpwn/visurf-devel

Handle IPv4 addresses in urlfilter v1 APPLIED

Martin Vahlensieck: 2
 Handle IPv4 addresses in urlfilter
 Use %s format instead of passing string directly

 2 files changed, 5 insertions(+), 2 deletions(-)
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   0cad23641..ed7001c64  master -> master
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/visurf-devel/patches/28112/mbox | git am -3
Learn more about email & git

[PATCH] Handle IPv4 addresses in urlfilter Export this patch

---
 tools/urlfilter | 3 +++
 1 file changed, 3 insertions(+)
 mode change 100644 => 100755 tools/urlfilter

diff --git a/tools/urlfilter b/tools/urlfilter
old mode 100644
new mode 100755
index f0019f2d3..c9b2b596e
--- a/tools/urlfilter
+++ b/tools/urlfilter
@@ -38,5 +38,8 @@ function escape(str, c, len, res) {
# Treat alpha.alpha/... as an http:// URL
/^([a-z]+\.)?[a-z]+\.[a-z]+\/?.*/ { print "https://" $0; next }

# IPv4 Addresses
/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[:\/].*$/ { print "http://" $0; next }

# Open everything else as a search
{ print "https://html.duckduckgo.com/html?q=" escape($0); next }
-- 
2.30.2
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   0cad23641..ed7001c64  master -> master

[PATCH] Use %s format instead of passing string directly Export this patch

---
 frontends/visurf/window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frontends/visurf/window.c b/frontends/visurf/window.c
index a4a6bbec8..3680ed43c 100644
--- a/frontends/visurf/window.c
+++ b/frontends/visurf/window.c
@@ -317,7 +317,7 @@ static int
draw_error_statusbar(struct nsvi_window *win, struct pool_buffer *buf)
{
	int width, height;
	get_text_size(buf->cairo, config.font, &width, &height, NULL, win->error_message);
	get_text_size(buf->cairo, config.font, &width, &height, NULL, "%s", win->error_message);

	cairo_set_source_u32(buf->cairo, config.status.error.bg);
	cairo_rectangle(buf->cairo, 0, win->height - (config.margin * 2 + height),
@@ -326,7 +326,7 @@ draw_error_statusbar(struct nsvi_window *win, struct pool_buffer *buf)

	cairo_set_source_u32(buf->cairo, config.status.error.fg);
	cairo_move_to(buf->cairo, config.margin, win->height - height - config.margin);
	pango_printf(buf->cairo, config.font, win->error_message);
	pango_printf(buf->cairo, config.font, "%s", win->error_message);
	return height + config.margin * 2;
}

-- 
2.30.2
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   0cad23641..ed7001c64  master -> master