mirror of
https://github.com/rclone/rclone
synced 2025-01-26 09:07:29 +01:00
s3: fix index out of range error with --fast-list fixes #2388
This commit is contained in:
parent
4c2fbf9b36
commit
4fe6614ae1
@ -864,7 +864,7 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) error {
|
|||||||
remote := key[rootLength:]
|
remote := key[rootLength:]
|
||||||
// is this a directory marker?
|
// is this a directory marker?
|
||||||
if (strings.HasSuffix(remote, "/") || remote == "") && *object.Size == 0 {
|
if (strings.HasSuffix(remote, "/") || remote == "") && *object.Size == 0 {
|
||||||
if recurse {
|
if recurse && remote != "" {
|
||||||
// add a directory in if --fast-list since will have no prefixes
|
// add a directory in if --fast-list since will have no prefixes
|
||||||
remote = remote[:len(remote)-1]
|
remote = remote[:len(remote)-1]
|
||||||
err = fn(remote, &s3.Object{Key: &remote}, true)
|
err = fn(remote, &s3.Object{Key: &remote}, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user