From ef99ca68aa94d7ea06c0ea8fa0cb9046d6ea367b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 31 Mar 2020 11:44:24 +0100 Subject: [PATCH] gcs: ignore directory markers at the root also See: https://forum.rclone.org/t/issue-with-lsf-r-files-only-first-line-is-blank/15229/ --- 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 f74f7087b..b0292d97c 100644 --- a/backend/googlecloudstorage/googlecloudstorage.go +++ b/backend/googlecloudstorage/googlecloudstorage.go @@ -555,7 +555,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck continue } remote = remote[len(prefix):] - isDirectory := strings.HasSuffix(remote, "/") + isDirectory := remote == "" || strings.HasSuffix(remote, "/") if addBucket { remote = path.Join(bucket, remote) }