Skip to content

Commit e968cda

Browse files
committed
fix(filesystem): use path_join() instead of string concat of paths in fs_scan, fixes #542
1 parent 9d4d2e0 commit e968cda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/neo-tree/sources/filesystem/lib/fs_scan.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ local function async_scan(context, path)
136136
if name == nil then
137137
break
138138
end
139-
local entry = current_dir .. os_sep .. name
139+
local entry = utils.path_join(current_dir, name)
140140
local success, item = pcall(file_items.create_item, ctx, entry, typ)
141141
if success then
142142
if ctx.recursive and item.type == "directory" then
@@ -187,7 +187,7 @@ local function sync_scan(context, path_to_scan)
187187
local success2, stats = pcall(vim.loop.fs_readdir, dir)
188188
if success2 and stats then
189189
for _, stat in ipairs(stats) do
190-
local path = path_to_scan .. utils.path_separator .. stat.name
190+
local path = utils.path_join(path_to_scan, stat.name)
191191
local success3, item = pcall(file_items.create_item, context, path, stat.type)
192192
if success3 then
193193
if context.recursive and stat.type == "directory" then

0 commit comments

Comments
 (0)