mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-27 00:29:08 +08:00
fix failure in lib_path if path is too long
This commit is contained in:
parent
8452f33407
commit
d02be816e2
21
vendor/lib/lib_path.cmd
vendored
21
vendor/lib/lib_path.cmd
vendored
@ -112,13 +112,28 @@ exit /b
|
|||||||
|
|
||||||
:end_enhance_path
|
:end_enhance_path
|
||||||
set "PATH=%PATH:;;=;%"
|
set "PATH=%PATH:;;=;%"
|
||||||
if NOT "%OLD_PATH%" == "%PATH%" (
|
|
||||||
|
if not "%OLD_PATH:~0,3000%" == "%OLD_PATH:~0,3001%" goto :toolong
|
||||||
|
if not "%PATH:~0,3000%" == "%PATH:~0,3001%" goto :toolong
|
||||||
|
if not "%OLD_PATH%" == "%PATH%" goto :changed
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:toolong
|
||||||
|
echo %OLD_PATH%>tempfileA
|
||||||
|
echo %PATH%>tempfileB
|
||||||
|
fc /b tempfileA tempfileB 2>nul 1>nul
|
||||||
|
if errorlevel 1 ( del tempfileA & del tempfileB & goto :changed )
|
||||||
|
del tempfileA & del tempfileB
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:changed
|
||||||
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
||||||
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
||||||
)
|
exit /b
|
||||||
set "position="
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|
||||||
:set_found
|
:set_found
|
||||||
if "%ERRORLEVEL%" == "0" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
set found=1
|
set found=1
|
||||||
|
Loading…
Reference in New Issue
Block a user