Merge pull request #2618 from xpam-net/master

Fix a problem with an ampersand character in path
This commit is contained in:
Dax T Games 2021-11-11 07:17:33 -05:00 committed by GitHub
commit a4cb56b083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ exit /b
set "find_query=%add_to_path%" set "find_query=%add_to_path%"
set "find_query=%find_query:\=\\%" set "find_query=%find_query:\=\\%"
set "find_query=%find_query: =\ %" set "find_query=%find_query: =\ %"
set OLD_PATH=%PATH% set "OLD_PATH=%PATH%"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
if "!found!" == "0" ( if "!found!" == "0" (
@ -121,8 +121,8 @@ exit /b
exit /b exit /b
:toolong :toolong
echo %OLD_PATH%>tempfileA echo "%OLD_PATH%">tempfileA
echo %PATH%>tempfileB echo "%PATH%">tempfileB
fc /b tempfileA tempfileB 2>nul 1>nul fc /b tempfileA tempfileB 2>nul 1>nul
if errorlevel 1 ( del tempfileA & del tempfileB & goto :changed ) if errorlevel 1 ( del tempfileA & del tempfileB & goto :changed )
del tempfileA & del tempfileB del tempfileA & del tempfileB