s3: strip trailing / from ListDir()

This commit is contained in:
Nick Craig-Wood 2014-07-24 23:01:04 +01:00
parent 1660903aa2
commit 125fc8f1f0

View File

@ -281,6 +281,9 @@ func (f *FsS3) list(directories bool, fn func(string, *s3.Key)) {
continue continue
} }
remote := remote[rootLength:] remote := remote[rootLength:]
if strings.HasSuffix(remote, "/") {
remote = remote[:len(remote)-1]
}
fn(remote, &s3.Key{Key: remote}) fn(remote, &s3.Key{Key: remote})
} }
} else { } else {