Skip to content

Commit

Permalink
Merge pull request #62 from Aphosis/fix/tostring-sep
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 authored Aug 29, 2024
2 parents 7a5a6fa + 0e98cef commit 0dd8d1d
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 0dd8d1d

Please sign in to comment.