Fix removing empty prefixes with mc rm command (#2912)

Fixes: 2909
This commit is contained in:
poornas
2019-10-12 09:49:14 +05:30
committed by kannappanr
parent aa4a4774da
commit 735aa139b1
+4
View File
@@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
@@ -218,6 +219,9 @@ func removeSingle(url string, isIncomplete bool, isFake, isForce bool, olderThan
errorIf(pErr.Trace(url), "Invalid argument `"+url+"`.")
return exitStatus(globalErrorExitStatus) // End of journey.
}
if !strings.HasSuffix(targetURL, string(clnt.GetURL().Separator)) && content.Type.IsDir() {
targetURL = targetURL + string(clnt.GetURL().Separator)
}
contentCh := make(chan *clientContent, 1)
contentCh <- &clientContent{URL: *newClientURL(targetURL)}