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

Merge pull request #127 from chrisant996/fixpushd

Fix leaked pushd
This commit is contained in:
Linwei
2020-12-30 23:01:17 +08:00
committed by GitHub

12
z.cmd
View File

@@ -106,13 +106,23 @@ if /i "%RunMode%"=="-n" (
pushd !NewPath!
pushd !NewPath!
endlocal
popd
goto popdir
)
)
) else (
call "%LuaExe%" "%LuaScript%" "%RunMode%" %MatchType% %StrictSub% %InterMode% %StripMode% %*
)
goto end
:popdir
rem -- Exploits variable expansion and the pushd stack to set the current
rem -- directory without leaking a pushd.
popd
setlocal
set NewPath=%CD%
endlocal & popd & cd /d "%NewPath%"
:end
echo.