summaryrefslogtreecommitdiffstats
path: root/lib/getopts.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-25 07:35:49 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-25 07:35:49 +0000
commitba6d3d04c004d526568a86e4e87b3572b879a35c (patch)
tree5eca6f91f9cb43e5ecdca6b536e65c0f6ca311fe /lib/getopts.lua
parente79a601326453d9a9178b1890da7057aef77a333 (diff)
downloadacf-core-ba6d3d04c004d526568a86e4e87b3572b879a35c.tar.bz2
acf-core-ba6d3d04c004d526568a86e4e87b3572b879a35c.tar.xz
Check if file exists or return nil
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@647 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/getopts.lua')
-rw-r--r--lib/getopts.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/getopts.lua b/lib/getopts.lua
index e0e7469..9668db2 100644
--- a/lib/getopts.lua
+++ b/lib/getopts.lua
@@ -1,7 +1,9 @@
module (..., package.seeall)
+require("fs")
function getoptsfromfile (file, search, filter)
local opts = nil
+ if not (fs.is_file(file)) then return nil end
local conf_file = fs.read_file_as_array ( file )
for i=1,table.maxn(conf_file) do
local l = conf_file[i]