We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 831d617 + e646d5b commit 9c0eb6cCopy full SHA for 9c0eb6c
z.cmd
@@ -106,13 +106,23 @@ if /i "%RunMode%"=="-n" (
106
pushd !NewPath!
107
108
endlocal
109
- popd
+ goto popdir
110
)
111
112
) else (
113
call "%LuaExe%" "%LuaScript%" "%RunMode%" %MatchType% %StrictSub% %InterMode% %StripMode% %*
114
115
116
+goto end
117
+
118
+:popdir
119
+rem -- Exploits variable expansion and the pushd stack to set the current
120
+rem -- directory without leaking a pushd.
121
+popd
122
+setlocal
123
+set NewPath=%CD%
124
+endlocal & popd & cd /d "%NewPath%"
125
126
:end
127
echo.
128
0 commit comments