aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/lfs_ext.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2014-11-25 23:19:31 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2014-11-25 23:19:31 -0500
commita18b06275cf412c7417c0301852d1366c9a67df6 (patch)
tree93210b1575f1c10bfd6756c1c5532f75de7fc749 /core/lfs_ext.lua
parent7e882577864f5c1a52265693856f3aedb23fe2f7 (diff)
Fixed bug when iterating over root directory; core/lfs_ext.lua
Files returned had two leading slashes (//etc, //usr, etc.).
Diffstat (limited to 'core/lfs_ext.lua')
-rw-r--r--core/lfs_ext.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index 4cda9871..e39fed72 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -89,7 +89,7 @@ function lfs.dir_foreach(dir, f, filter, exclude_FILTER, n, include_dirs, level)
local dir_sep, lfs_attributes = not WIN32 and '/' or '\\', lfs.attributes
for file in lfs.dir(dir) do
if not file:find('^%.%.?$') then -- ignore . and ..
- file = dir..dir_sep..file
+ file = dir..(dir ~= '/' and dir_sep or '')..file
local type = lfs_attributes(file, 'mode')
if type == 'directory' and not exclude(file, filter.folders) then
if include_dirs and f(file..dir_sep) == false then return end