summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/base/luasrc/ltn12.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/base/luasrc/ltn12.lua b/modules/base/luasrc/ltn12.lua
index 9371290c61..b59fb8c48a 100644
--- 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