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

s3: strip trailing / from ListDir()

Nick Craig-Wood125fc8f1f0ed
diff --git a/s3/s3.go b/s3/s3.go
index ed2bf8cd7..8c0e3f71f 100644
--- a/s3/s3.go
+++ b/s3/s3.go
@@ -281,6 +281,9 @@ func (f *FsS3) list(directories bool, fn func(string, *s3.Key)) {
continue
}
remote := remote[rootLength:]
+ if strings.HasSuffix(remote, "/") {
+ remote = remote[:len(remote)-1]
+ }
fn(remote, &s3.Key{Key: remote})
}
} else {