From afa27b98474fe257381f051c5aba7cab636c897b Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 21 Oct 2015 22:00:03 -0700 Subject: [PATCH] On windows translate Prefix, Marker and Delimiter for paths --- pkg/fs/fs-bucket.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/fs/fs-bucket.go b/pkg/fs/fs-bucket.go index ff48f9521..2d5828245 100644 --- a/pkg/fs/fs-bucket.go +++ b/pkg/fs/fs-bucket.go @@ -220,10 +220,10 @@ func (fs Filesystem) ListObjects(bucket string, resources BucketResourcesMetadat p.root = rootPrefix /// automatically treat "/" delimiter as "\\" delimiter on windows due to its path constraints. - if resources.Delimiter == "/" { - if runtime.GOOS == "windows" { - resources.Delimiter = string(os.PathSeparator) - } + if runtime.GOOS == "windows" { + resources.Prefix = strings.Replace(resources.Prefix, "/", string(os.PathSeparator), -1) + resources.Delimiter = strings.Replace(resources.Delimiter, "/", string(os.PathSeparator), -1) + resources.Marker = strings.Replace(resources.Marker, "/", string(os.PathSeparator), -1) } // if delimiter is supplied and not prefix then we are the very top level, list everything and move on.