From ea9fa95a5410fe546ba6095ee9873d9f22ee7f7c Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sat, 29 Apr 2017 08:57:50 +0200 Subject: [PATCH] util.lua: fix lfs require in isEmptyDir() Pointed out by @poire-z https://github.com/koreader/koreader/commit/ed7937f65d0891f54491be8f77f9864edaaad460#commitcomment-21956632 --- frontend/util.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/util.lua b/frontend/util.lua index 9f1968c5f..276d70a96 100644 --- a/frontend/util.lua +++ b/frontend/util.lua @@ -287,7 +287,8 @@ end ---- @string path ---- @treturn bool function util.isEmptyDir(path) - for filename in require("lfs").dir(path) do + local lfs = require("libs/libkoreader-lfs") + for filename in lfs.dir(path) do if filename ~= '.' and filename ~= '..' then return false end