diff options
Diffstat (limited to 'runtime/lua/vim/fs.lua')
-rw-r--r-- | runtime/lua/vim/fs.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index c89147dbd2..cdb314fa3d 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -348,9 +348,7 @@ function M.normalize(path, opts) path = path:gsub('%$([%w_]+)', vim.uv.os_getenv) end - path = path:gsub('\\', '/'):gsub('/+', '/') - - return path:sub(-1) == '/' and path:sub(1, -2) or path + return (path:gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) end return M |