acd: Fix overwriting a file with a zero length file

This commit is contained in:
Nick Craig-Wood 2016-11-02 16:39:55 +00:00
parent 318e335137
commit 2302179237

View File

@ -832,9 +832,9 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error {
start := time.Now()
o.fs.startUpload()
if size != 0 {
info, resp, err = file.OverwriteSized(in, size)
} else {
info, resp, err = file.Overwrite(in)
} else {
info, resp, err = file.OverwriteSized(in, size)
}
o.fs.stopUpload()
var ok bool