From 19464369c3612ff8f431a2bed62861f4d20cabc4 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 12 Aug 2018 23:44:58 -0400 Subject: Fix /open ranges by passing all URLs to open(1) This is going to be incompatible with xdg-open since it takes only one URL at a time. Write a wrapper script. --- input.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index cb7575f..c2599c1 100644 --- a/input.c +++ b/input.c @@ -90,14 +90,9 @@ static void inputUrl(struct Tag tag, char *params) { urlList(tag); } static void inputOpen(struct Tag tag, char *params) { - if (!params) { urlOpen(tag, 1); return; } - size_t from = strtoul(strsep(¶ms, "-,"), NULL, 0); - if (!params) { urlOpen(tag, from); return; } - size_t to = strtoul(strsep(¶ms, "-,"), NULL, 0); - if (to < from) to = from; - for (size_t i = from; i <= to; ++i) { - urlOpen(tag, i); - } + size_t at = (params ? strtoul(strsep(¶ms, "-,"), NULL, 0) : 1); + size_t to = (params ? strtoul(params, NULL, 0) : at); + urlOpen(tag, at - 1, to); } static void inputView(struct Tag tag, char *params) { -- cgit 1.4.1-2-gfad0