From be17ee5a405ceb3945cbaddffb5659e0e6cacdda Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 20 Aug 2021 17:38:25 +0200 Subject: [PATCH] Complete Trailing Slashes Fix --- main.go | 8 ++++---- 1 file 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,