Skip to content

Commit a7c0e06

Browse files
authored
implement fix suggested in #2990 (comment)
1 parent 43ab19a commit a7c0e06

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vendor/lib/lib_path.cmd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ exit /b
127127
exit /b
128128

129129
:toolong
130-
echo "%OLD_PATH%">"%temp%\cmder_lib_pathA"
131-
echo "%PATH%">"%temp%\cmder_lib_pathB"
132-
fc /b "%temp%\cmder_lib_pathA" "%temp%\cmder_lib_pathB" 2>nul 1>nul
133-
if errorlevel 1 ( del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" & goto :changed )
134-
del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB"
130+
set "_rand=%RANDOM%"
131+
echo "%OLD_PATH%">"%temp%\%_rand%_cmder_lib_pathA"
132+
echo "%PATH%">"%temp%\%_rand%_cmder_lib_pathB"
133+
fc /b "%temp%\%_rand%_cmder_lib_pathA" "%temp%\%_rand%_cmder_lib_pathB" 2>nul 1>nul
134+
if errorlevel 1 ( del "%temp%\%_rand%_cmder_lib_pathA" & del "%temp%\%_rand%_cmder_lib_pathB" & set "_rand=" & goto :changed )
135+
del "%temp%\%_rand%_cmder_lib_pathA" & del "%temp%\%_rand%_cmder_lib_pathB" & set "_rand="
135136
exit /b
136137

137138
:changed

0 commit comments

Comments
 (0)