aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2021-08-20 17:38:25 +0200
committerQuentin <quentin@deuxfleurs.fr>2021-08-20 17:38:25 +0200
commitbe17ee5a405ceb3945cbaddffb5659e0e6cacdda (patch)
tree159c7b5973be50c0d1d97e31023b0e547074730d
parent1cc0de75a671f3b9496ba901abfddae32b316401 (diff)
downloadbagage-be17ee5a405ceb3945cbaddffb5659e0e6cacdda.tar.gz
bagage-be17ee5a405ceb3945cbaddffb5659e0e6cacdda.zip
Complete Trailing Slashes Fix
-rw-r--r--main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.go b/main.go
index 2595a83..79ef4df 100644
--- a/main.go
+++ b/main.go
@@ -334,10 +334,10 @@ func (gf *GarageFile) readDirRoot(count int) ([]fs.FileInfo, error) {
}
func (gf *GarageFile) readDirChild(count int) ([]fs.FileInfo, error) {
- prefix := gf.path.key
- if prefix[len(prefix)-1:] != "/" {
- prefix = prefix + "/"
- }
+ prefix := gf.path.key
+ if len(prefix) > 0 && prefix[len(prefix)-1:] != "/" {
+ prefix = prefix + "/"
+ }
objs_info := gf.mc.ListObjects(gf.ctx, gf.path.bucket, minio.ListObjectsOptions{
Prefix: prefix,