aboutsummaryrefslogtreecommitdiff
path: root/core/lfs_ext.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-03-11 20:42:01 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-03-11 20:42:01 -0400
commit0dfec8e9c0689975cc20217b01fde1be09cf243a (patch)
tree90a64fc4265b7e2d0369dd8d1531ba0ec67300fc /core/lfs_ext.lua
parent84fd28ad486d4d16e437e8d8eae7d8855fd23ccd (diff)
downloadtextadept-0dfec8e9c0689975cc20217b01fde1be09cf243a.tar.gz
textadept-0dfec8e9c0689975cc20217b01fde1be09cf243a.zip
More code cleanup, refactoring, and formatting.
Diffstat (limited to 'core/lfs_ext.lua')
-rw-r--r--core/lfs_ext.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index ada0431e..59318da8 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -81,8 +81,7 @@ function lfs.dir_foreach(dir, f, filter, n, include_dirs, level)
end
for basename in lfs.dir(dir) do
if basename:find('^%.%.?$') then goto continue end -- ignore . and ..
- local filename = string.format(
- '%s%s%s', dir, dir ~= '/' and '/' or '', basename)
+ local filename = dir .. (dir ~= '/' and '/' or '') .. basename
local mode = lfs.attributes(filename, 'mode')
if mode ~= 'directory' and mode ~= 'file' then goto continue end
local include
@@ -129,8 +128,7 @@ function lfs.abspath(filename, prefix)
if not filename:find(not WIN32 and '^/' or '^%a:[/\\]') and
not (WIN32 and filename:find('^\\\\')) then
if not prefix then prefix = lfs.currentdir() end
- filename = string.format(
- '%s%s%s', prefix, not WIN32 and '/' or '\\', filename)
+ filename = prefix .. (not WIN32 and '/' or '\\') .. filename
end
filename = filename:gsub('%f[^/\\]%.[/\\]', '') -- clean up './'
while filename:find('[^/\\]+[/\\]%.%.[/\\]') do