X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/edc5e4b6645b9b983a85a892bf3d3ad1432a657d..b1d1c5acf6f237d5e2a02414dd59e92cdb862237:/apps/workbench/app/controllers/collections_controller.rb diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index 3606ef0c8a..3c248757ec 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -326,8 +326,7 @@ class CollectionsController < ApplicationController bytesleft = @opts[:maxbytes].andand.to_i || 2**16 IO.popen([env, 'arv-get', "#{@opts[:uuid]}/#{@opts[:file]}"], 'rb') do |io| - bytecount = 0 - while bytesleft > 0 && buf = io.read(bytesleft) + while bytesleft > 0 && (buf = io.read(bytesleft)) != nil # shrink the bytesleft count, if we were given a # maximum byte count to read if @opts.include? :maxbytes