mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit f28e1c01581312f4f71abec0ad3c85d480922936
parent a3f4227c318f5df86b1450782c664d02a6ea7824
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Thu, 28 Jul 2016 19:51:11 +0200

seq: parse .: correctly

Diffstat:
seq.c | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git 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;