s3: ignore zero length directory markers - fixes #1621
This commit is contained in:
parent
911a78ce6d
commit
a46f2a9eb7
1 changed files with 12 additions and 0 deletions
|
@ -549,6 +549,18 @@ func (f *Fs) list(dir string, recurse bool, fn listFn) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
remote := key[rootLength:]
|
remote := key[rootLength:]
|
||||||
|
// is this a directory marker?
|
||||||
|
if strings.HasSuffix(remote, "/") && *object.Size == 0 {
|
||||||
|
if recurse {
|
||||||
|
// add a directory in if --fast-list since will have no prefixes
|
||||||
|
remote = remote[:len(remote)-1]
|
||||||
|
err = fn(remote, &s3.Object{Key: &remote}, true)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue // skip directory marker
|
||||||
|
}
|
||||||
err = fn(remote, object, false)
|
err = fn(remote, object, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Reference in a new issue