cp: more trimming necessary.

This commit is contained in:
Harshavardhana
2015-11-15 23:06:57 -08:00
parent 659a795ac4
commit eb35b5d9ee
+4 -2
View File
@@ -290,8 +290,10 @@ func prepareCopyURLsTypeC(sourceURL, targetURL string) <-chan copyURLs {
}
// All OK.. We can proceed. Type B: source is a file, target is a folder and exists.
newSourceURL := sourceContent.Content.URL.String()
newSourceSuffix := strings.TrimPrefix(newSourceURL, sourceURL)
srcURL := sourceClient.GetURL()
newSourceURL := sourceContent.Content.URL
newSourceSuffix := strings.TrimPrefix(newSourceURL.Path,
srcURL.Path[:strings.LastIndex(srcURL.Path, string(srcURL.Separator))])
newTargetURL := urlJoinPath(targetURL, newSourceSuffix)
copyURLsCh <- prepareCopyURLsTypeA(sourceContent.Content.URL.String(), newTargetURL)
}