1
mirror of https://github.com/rclone/rclone synced 2024-12-26 18:23:45 +01:00

gcs: fix index out of range error with --fast-list fixes #2388

This commit is contained in:
Nick Craig-Wood 2018-07-09 17:00:14 +01:00
parent 4fe6614ae1
commit 793f594b07

View File

@ -480,7 +480,7 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) (err error) {
remote := object.Name[rootLength:]
// is this a directory marker?
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
err = fn(remote[:len(remote)-1], object, true)
if err != nil {