cp: Fix Windows paths (#3250)

Paths without `/` separator were not trimmed correctly.

Fixes #3241

Regression originating from #3115
This commit is contained in:
Klaus Post
2020-06-10 09:31:59 -07:00
committed by GitHub
parent c51e3b3ec9
commit bdefdc0169
+1 -1
View File
@@ -201,7 +201,7 @@ func makeCopyContentTypeC(sourceAlias string, sourceURL ClientURL, sourceContent
return URLs{Error: probe.NewError(err)}
}
if fileInfo.IsDir() {
sourcePrefix = sourceURL.Path
sourcePrefix = filepath.ToSlash(sourceURL.Path)
}
}
newSourceSuffix = strings.TrimPrefix(newSourceSuffix, sourcePrefix)