Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lua/plenary/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,6 @@ function Path:rename(opts)
-- uses stat)
assert(self_lstat, ("%s: %s"):format(errmsg, self.filename))

-- BUG
-- handles `.`, `..`, `./`, and `../`
if opts.new_name:match "^%.%.?/?\\?.+" then
opts.new_name = {
uv.fs_realpath(opts.new_name:sub(1, 3)),
opts.new_name:sub(4),
}
end

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this as it contains a bug. Secondly, it is unnecessary, as uv.fs_rename already handles such relative paths.

local new_path = Path:new(opts.new_name)
new_lstat, errmsg = uv.fs_lstat(new_path.filename)

Expand Down