Skip to content

Commit 0dd8d1d

Browse files
authored
Merge pull request #62 from Aphosis/fix/tostring-sep
2 parents 7a5a6fa + 0e98cef commit 0dd8d1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/pathlib/base.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,10 +1186,11 @@ end
11861186
function Path:tostring(sep)
11871187
local nocache = sep and sep ~= self.sep_str
11881188
if nocache or not self.__string_cache then
1189-
local s = table.concat(self._raw_paths, self.sep_str)
1189+
sep = sep or self.sep_str
1190+
local s = table.concat(self._raw_paths, sep)
11901191
if self:is_absolute() then
11911192
if #self._raw_paths == 1 then
1192-
s = self.sep_str
1193+
s = sep
11931194
end
11941195
if self._drive_name:len() > 0 then
11951196
s = self._drive_name .. s

0 commit comments

Comments
 (0)