From 7d66bb8db70d6e3f5009bde30795477bd5d46372 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 1 Jul 2017 12:46:45 +0200 Subject: seq: parse_range: = _ and ^ default to being relative to cur instead of message 1 --- seq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'seq.c') 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++; -- cgit 1.4.1