forked from TrueCloudLab/rclone
swift: return directories without / in ListDir
This commit is contained in:
parent
a5b0d88608
commit
b013c58537
1 changed files with 5 additions and 2 deletions
|
@ -201,8 +201,11 @@ func (f *FsSwift) list(directories bool, fn func(string, *swift.Object)) {
|
||||||
for i := range objects {
|
for i := range objects {
|
||||||
object := &objects[i]
|
object := &objects[i]
|
||||||
// FIXME if there are no directories, swift gives back the files for some reason!
|
// FIXME if there are no directories, swift gives back the files for some reason!
|
||||||
if directories && !strings.HasSuffix(object.Name, "/") {
|
if directories {
|
||||||
continue
|
if !strings.HasSuffix(object.Name, "/") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
object.Name = object.Name[:len(object.Name)-1]
|
||||||
}
|
}
|
||||||
if !strings.HasPrefix(object.Name, f.root) {
|
if !strings.HasPrefix(object.Name, f.root) {
|
||||||
fs.Log(f, "Odd name received %q", object.Name)
|
fs.Log(f, "Odd name received %q", object.Name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue