From a5c2f2c138166aa0a57e24428808e94e6b2851c6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 31 Mar 2020 11:43:51 +0100 Subject: [PATCH] s3: 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/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 2e1f1d574..69614ef06 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -1464,7 +1464,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) }