From 5ba5be9b37381ca2293bc1b11b52b654ed60f67b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 21 Mar 2018 20:10:00 +0000 Subject: [PATCH] gcs: ignore zero length directory markers at the root too --- backend/googlecloudstorage/googlecloudstorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.go index 7e2cd5c65..7ca0ad24a 100644 --- a/backend/googlecloudstorage/googlecloudstorage.go +++ b/backend/googlecloudstorage/googlecloudstorage.go @@ -438,7 +438,7 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) error { } remote := object.Name[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 err = fn(remote[:len(remote)-1], object, true)