Merge pull request #257 from NeoRaider/master

modules/base: ltn12: fix source.file() termination condition
This commit is contained in:
Jo-Philipp Wich 2014-11-17 15:21:47 +01:00
commit f81be49ae7

View file

@ -144,6 +144,7 @@ function source.file(handle, io_err)
if handle then
return function()
local chunk = handle:read(BLOCKSIZE)
if chunk and chunk:len() == 0 then chunk = nil end
if not chunk then handle:close() end
return chunk
end