diff options
author | Curtis McEnroe | 2018-09-11 14:36:30 -0400 |
---|---|---|
committer | Curtis McEnroe | 2018-09-11 14:36:30 -0400 |
commit | 068cff107e7147ba9dc8fb723a07a6d0a4bd80dd (patch) | |
tree | 5e87b809db205e1c865a585320fcd2082ea2cc0c /input.c | |
parent | a0ff0d5c46d439341d2d135a9864a9e5f8ff9055 (diff) |
Add urlOpenMatch
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 11 |
1 files changed, 8 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. */ +#include <ctype.h> #include <err.h> #include <stdbool.h> #include <stdio.h> @@ -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) { |