Skip to content

Commit

Permalink
fix(base): Path:tostring sep argument is not longer ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
Aphosis committed Aug 29, 2024
1 parent 7a5a6fa commit 0e98cef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/pathlib/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1186,10 +1186,11 @@ end
function Path:tostring(sep)
local nocache = sep and sep ~= self.sep_str
if nocache or not self.__string_cache then
local s = table.concat(self._raw_paths, self.sep_str)
sep = sep or self.sep_str
local s = table.concat(self._raw_paths, sep)
if self:is_absolute() then
if #self._raw_paths == 1 then
s = self.sep_str
s = sep
end
if self._drive_name:len() > 0 then
s = self._drive_name .. s
Expand Down

0 comments on commit 0e98cef

Please sign in to comment.