From 764440068edadf42474a1af3ff8142e4e4079a10 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 26 Apr 2018 09:17:22 +0100 Subject: [PATCH] filter: fix --min-age and --max-age together check Somehow in the code reorganisation of 11da2a6c9bd1a903a7737e9314617810f1903c5c the check for --min-age and --max-age got switched around. This commit fixes that and means you can use --min-age and --max-age together. --- fs/filter/filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/filter/filter.go b/fs/filter/filter.go index 9a9f79994..fd4da9676 100644 --- a/fs/filter/filter.go +++ b/fs/filter/filter.go @@ -130,7 +130,7 @@ func NewFilter(opt *Opt) (f *Filter, err error) { } if f.Opt.MaxAge.IsSet() { f.ModTimeFrom = time.Now().Add(-time.Duration(f.Opt.MaxAge)) - if !f.ModTimeTo.IsZero() && f.ModTimeFrom.Before(f.ModTimeTo) { + if !f.ModTimeTo.IsZero() && f.ModTimeTo.Before(f.ModTimeFrom) { log.Fatal("filter: --min-age can't be larger than --max-age") } fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)