Merge pull request #257 from NeoRaider/master
modules/base: ltn12: fix source.file() termination condition
This commit is contained in:
commit
f81be49ae7
1 changed files with 1 additions and 0 deletions
|
@ -144,6 +144,7 @@ function source.file(handle, io_err)
|
||||||
if handle then
|
if handle then
|
||||||
return function()
|
return function()
|
||||||
local chunk = handle:read(BLOCKSIZE)
|
local chunk = handle:read(BLOCKSIZE)
|
||||||
|
if chunk and chunk:len() == 0 then chunk = nil end
|
||||||
if not chunk then handle:close() end
|
if not chunk then handle:close() end
|
||||||
return chunk
|
return chunk
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue