aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2017-07-01 12:46:45 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-07-02 18:44:55 +0200
commit7d66bb8db70d6e3f5009bde30795477bd5d46372 (patch)
tree34d7c7c64c75a46ed234448ce2f165585544758b
parentef65274d43e7ab1d8a7f4fce353bb6a173bda987 (diff)
downloadmblaze-7d66bb8db70d6e3f5009bde30795477bd5d46372.tar.gz
seq: parse_range: = _ and ^ default to being relative to cur instead of message 1
-rw-r--r--seq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/seq.c b/seq.c
index c1b51bd..def14fe 100644
--- a/seq.c
+++ b/seq.c
@@ -337,7 +337,8 @@ parse_parent(char *map, long *starto, long *stopo)
static int
parse_range(char *map, char *a, long *start, long *stop, long cur, long lines)
{
- *start = *stop = 1;
+ *start = 0;
+ *stop = 1;
while (*a && *a != ':' && *a != '=' && *a != '_' && *a != '^') {
char *b = parse_relnum(a, cur, lines, start);
@@ -345,6 +346,8 @@ parse_range(char *map, char *a, long *start, long *stop, long cur, long lines)
return 0;
a = b;
}
+ if (*start == 0)
+ *start = strchr("=^_", *a) ? cur : 1;
while (*a == '^') {
a++;