onedrive: fix overwrite detection in Copy - fixes #1224

This commit is contained in:
Nick Craig-Wood 2017-03-11 22:22:13 +00:00
parent 488353c977
commit f046c00d3b

View file

@ -600,8 +600,10 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) {
return nil, err return nil, err
} }
if strings.ToLower(srcObj.remote) == strings.ToLower(remote) { srcPath := srcObj.fs.rootSlash() + srcObj.remote
return nil, errors.Errorf("can't copy %q -> %q as are same name when lowercase", srcObj.remote, remote) dstPath := f.rootSlash() + remote
if strings.ToLower(srcPath) == strings.ToLower(dstPath) {
return nil, errors.Errorf("can't copy %q -> %q as are same name when lowercase", srcPath, dstPath)
} }
// Create temporary object // Create temporary object