Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: ignore directory markers at the root also

Nick Craig-Woodb5f78cd7b4fe
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]
}