From 068cff107e7147ba9dc8fb723a07a6d0a4bd80dd Mon Sep 17 00:00:00 2001
From: Curtis McEnroe
Date: Tue, 11 Sep 2018 14:36:30 -0400
Subject: Add urlOpenMatch
---
input.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
(limited to 'input.c')
diff --git a/input.c b/input.c
index 6e95b11..4497010 100644
--- a/input.c
+++ b/input.c
@@ -14,6 +14,7 @@
* along with this program. If not, see .
*/
+#include
#include
#include
#include
@@ -107,9 +108,13 @@ static void inputUrl(struct Tag tag, char *params) {
urlList(tag);
}
static void inputOpen(struct Tag tag, char *params) {
- size_t at = (params ? strtoul(strsep(¶ms, "-,"), NULL, 0) : 1);
- size_t to = (params ? strtoul(params, NULL, 0) : at);
- urlOpen(tag, at - 1, to);
+ if (params && !isdigit(params[0])) {
+ urlOpenMatch(tag, params);
+ } else {
+ size_t at = (params ? strtoul(strsep(¶ms, "-,"), NULL, 0) : 1);
+ size_t to = (params ? strtoul(params, NULL, 0) : at);
+ urlOpenRange(tag, at - 1, to);
+ }
}
static void inputView(struct Tag tag, char *params) {
--
cgit 1.4.1-2-gfad0