From e9a2cbec378c7c230dd79c774f045b24447264bc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 21 Mar 2018 20:09:37 +0000 Subject: [PATCH] s3: ignore zero length directory markers at the root too --- backend/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 132a6e202..4472d0445 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -550,7 +550,7 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) error { } remote := key[rootLength:] // is this a directory marker? - if strings.HasSuffix(remote, "/") && *object.Size == 0 { + if (strings.HasSuffix(remote, "/") || remote == "") && *object.Size == 0 { if recurse { // add a directory in if --fast-list since will have no prefixes remote = remote[:len(remote)-1]