From a18b06275cf412c7417c0301852d1366c9a67df6 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 25 Nov 2014 23:19:31 -0500 Subject: Fixed bug when iterating over root directory; core/lfs_ext.lua Files returned had two leading slashes (//etc, //usr, etc.). --- core/lfs_ext.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/lfs_ext.lua') 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 -- cgit v1.2.3