1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-12 10:49:49 +00:00

Merge pull request #216 from chrisant996/fix_invalid_path_on_window

Fix invalid pathname in `z -I xyz` on Windows.
This commit is contained in:
Linwei
2025-05-15 22:14:44 +08:00
committed by GitHub

4
z.lua
View File

@@ -1676,7 +1676,7 @@ function z_cd(patterns)
end
cmd = cmd .. ' < "' .. tmpname .. '"'
else
tmpname = os.tmpname():gsub('\\', ''):gsub('%.', '')
tmpname = os.tmpname():gsub('[\\:]', ''):gsub('%.', '')
tmpname = os.environ('TMP', '') .. '\\zlua_' .. tmpname .. '.txt'
cmd = 'type "' .. tmpname .. '" | ' .. cmd
end
@@ -1873,7 +1873,7 @@ function cd_breadcrumbs(pwd, interactive)
if not windows then
tmpname = os.tmpname()
else
tmpname = os.tmpname():gsub('\\', ''):gsub('%.', '')
tmpname = os.tmpname():gsub('[\\:]', ''):gsub('%.', '')
tmpname = os.environ('TMP', '') .. '\\zlua_' .. tmpname .. '.txt'
end
fp = io.open(tmpname, 'w')