mirror of
https://github.com/rclone/rclone.git
synced 2025-02-21 01:47:09 +08:00
s3: fix multipart copy - fixes #3778
Before this change multipart copies were giving the error Range specified is not valid for source object of size This was due to an off by one error in the range source introduced in 7b1274e29ac51231 "s3: support for multipart copy"
This commit is contained in:
parent
c05bb63f96
commit
f4746f5064
@ -1666,8 +1666,8 @@ func calculateRange(partSize, partIndex, numParts, totalSize int64) string {
|
||||
start := partIndex * partSize
|
||||
var ends string
|
||||
if partIndex == numParts-1 {
|
||||
if totalSize >= 0 {
|
||||
ends = strconv.FormatInt(totalSize, 10)
|
||||
if totalSize >= 1 {
|
||||
ends = strconv.FormatInt(totalSize-1, 10)
|
||||
}
|
||||
} else {
|
||||
ends = strconv.FormatInt(start+partSize-1, 10)
|
||||
|
Loading…
x
Reference in New Issue
Block a user