union: fix duplicated files when using directories with leading /

See: https://forum.rclone.org/t/union-backend-copying-to-all-remotes-while-it-shouldnt/31781
This commit is contained in:
Nick Craig-Wood 2022-07-09 21:13:06 +01:00
parent 80c5850ee8
commit a6fba1f0c6
1 changed files with 1 additions and 0 deletions

View File

@ -834,6 +834,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
}
}
root = strings.Trim(root, "/")
upstreams := make([]*upstream.Fs, len(opt.Upstreams))
errs := Errors(make([]error, len(opt.Upstreams)))
multithread(len(opt.Upstreams), func(i int) {