summaryrefslogtreecommitdiffhomepage
path: root/modules/base
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-11-17 15:21:47 +0100
committerJo-Philipp Wich <jow@openwrt.org>2014-11-17 15:21:47 +0100
commitf81be49ae756dab82e1758a6c9de145f0d36960e (patch)
tree4066d4bca96253af79e98254ed44cf018ed29aeb /modules/base
parenta226f199accb4a9adce10d3373fb832109e60876 (diff)
parent7bd68db7d702c5951d192359f2dd6b256a98c62d (diff)
Merge pull request #257 from NeoRaider/master
modules/base: ltn12: fix source.file() termination condition
Diffstat (limited to 'modules/base')
-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 9371290c6..b59fb8c48 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