mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-14 07:29:12 +08:00
Fix a problem with an ampersand character in path
If the path variable contained values with an ampersand character (such as in the case of MySQL), the string splits by this character, and tries to execute what follows as a separate command. All occurrences of the set command containing %PATH% should be wrapped in quotation marks
This commit is contained in:
parent
93715461e6
commit
4c85e8b2f1
6
vendor/lib/lib_path.cmd
vendored
6
vendor/lib/lib_path.cmd
vendored
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user