diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-02-26 11:17:46 -0500 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-02-26 11:17:46 -0500 |
commit | 0e07b7478899600805c32564f1b88c1aaedbe16f (patch) | |
tree | 0a0db93a3ba009e06e0cafc700b78cd65fba3e24 /core/lfs_ext.lua | |
parent | a291022fbd9dbc749508917dfa10f40ad0323436 (diff) |
Small code cleanup.
Diffstat (limited to 'core/lfs_ext.lua')
-rw-r--r-- | core/lfs_ext.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua index 05749df3..c71c42bc 100644 --- a/core/lfs_ext.lua +++ b/core/lfs_ext.lua @@ -76,11 +76,11 @@ function lfs.dir_foreach(dir, f, filter, n, include_dirs, level) end filter = processed_filter end - local dir_sep, lfs_attributes = not WIN32 and '/' or '\\', lfs.attributes + local dir_sep = not WIN32 and '/' or '\\' for basename in lfs.dir(dir) do if basename:find('^%.%.?$') then goto continue end -- ignore . and .. local filename = dir..(dir ~= '/' and dir_sep or '')..basename - local mode = lfs_attributes(filename, 'mode') + local mode = lfs.attributes(filename, 'mode') if mode ~= 'directory' and mode ~= 'file' then goto continue end local include if mode == 'file' then @@ -123,7 +123,7 @@ function lfs.abspath(filename, prefix) if WIN32 then filename = filename:gsub('/', '\\') end if not filename:find(not WIN32 and '^/' or '^%a:[/\\]') and not (WIN32 and filename:find('^\\\\')) then - prefix = prefix or lfs.currentdir() + if not prefix then prefix = lfs.currentdir() end filename = prefix..(not WIN32 and '/' or '\\')..filename end filename = filename:gsub('%f[^/\\]%.[/\\]', '') -- clean up './' |