projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
modules/base: ltn12: source.file() should terminate when an empty chunk is read
[project/luci.git]
/
modules
/
base
/
luasrc
/
ltn12.lua
diff --git
a/modules/base/luasrc/ltn12.lua
b/modules/base/luasrc/ltn12.lua
index
9371290
..
b59fb8c
100644
(file)
--- a/
modules/base/luasrc/ltn12.lua
+++ b/
modules/base/luasrc/ltn12.lua
@@
-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