From bba32beb8a9e8f39f4cf26013c17d8c1eff9b63c Mon Sep 17 00:00:00 2001 From: Yong Jie Date: Thu, 29 Aug 2019 01:05:18 +0800 Subject: [PATCH] Fix bug where lfcd.cmd does not CD to different drive (#221) --- etc/lfcd.cmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/lfcd.cmd b/etc/lfcd.cmd index f225900..1d95098 100644 --- a/etc/lfcd.cmd +++ b/etc/lfcd.cmd @@ -5,11 +5,11 @@ rem You need to put this file to a folder in %PATH% variable. :tmploop set tmpfile="%tmp%\lf.%random%.tmp" -if exist "%tmpfile%" goto:tmploop -lf -last-dir-path="%tmpfile%" %* -if not exist "%tmpfile%" exit -set /p dir=<"%tmpfile%" -del /f "%tmpfile%" +if exist %tmpfile% goto:tmploop +lf -last-dir-path=%tmpfile% %* +if not exist %tmpfile% exit +set /p dir=<%tmpfile% +del /f %tmpfile% if not exist "%dir%" exit if "%dir%" == "%cd%" exit -cd "%dir%" +cd /d "%dir%"