Skip to content

Commit c3a182c

Browse files
authored
Merge pull request #216 from chrisant996/fix_invalid_path_on_window
Fix invalid pathname in `z -I xyz` on Windows.
2 parents 4bbd0f1 + 771c72d commit c3a182c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

z.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ function z_cd(patterns)
16761676
end
16771677
cmd = cmd .. ' < "' .. tmpname .. '"'
16781678
else
1679-
tmpname = os.tmpname():gsub('\\', ''):gsub('%.', '')
1679+
tmpname = os.tmpname():gsub('[\\:]', ''):gsub('%.', '')
16801680
tmpname = os.environ('TMP', '') .. '\\zlua_' .. tmpname .. '.txt'
16811681
cmd = 'type "' .. tmpname .. '" | ' .. cmd
16821682
end
@@ -1873,7 +1873,7 @@ function cd_breadcrumbs(pwd, interactive)
18731873
if not windows then
18741874
tmpname = os.tmpname()
18751875
else
1876-
tmpname = os.tmpname():gsub('\\', ''):gsub('%.', '')
1876+
tmpname = os.tmpname():gsub('[\\:]', ''):gsub('%.', '')
18771877
tmpname = os.environ('TMP', '') .. '\\zlua_' .. tmpname .. '.txt'
18781878
end
18791879
fp = io.open(tmpname, 'w')

0 commit comments

Comments
 (0)