From f28e1c01581312f4f71abec0ad3c85d480922936 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Thu, 28 Jul 2016 19:51:11 +0200 Subject: seq: parse .: correctly --- seq.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'seq.c') diff --git a/seq.c b/seq.c index 7c9fc12..261c461 100644 --- a/seq.c +++ b/seq.c @@ -179,11 +179,18 @@ parse_relnum(char *a, long cur, long last, long *out) } else { base = 0; } - errno = 0; - long d = strtol(a, &b, 10); - if (errno != 0) { - perror("strtol"); - exit(1); + + long d; + if (*a == ':') { + d = 0; + b = a; + } else { + errno = 0; + d = strtol(a, &b, 10); + if (errno != 0) { + perror("strtol"); + exit(1); + } } *out = base + d; -- cgit 1.4.1