From b5f78cd7b4fe7082e81a5ef0e0f382840a10bd5c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 31 Mar 2020 11:45:09 +0100 Subject: [PATCH] b2: 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/b2/b2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 98212e27a..c622c7ba7 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -668,7 +668,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck } remote := file.Name[len(prefix):] // Check for directory - isDirectory := strings.HasSuffix(remote, "/") + isDirectory := remote == "" || strings.HasSuffix(remote, "/") if isDirectory { remote = remote[:len(remote)-1] }