make.bat: support existing toolchain paths with spaces

Previously if the default go toolchain (from "where go") contained
spaces, then running make.bat would fail.

Fixes it to correctly treat paths with spaces. This is especially useful
given that the default Go install path is under "C:\Program Files".

Fixes #57918
This commit is contained in:
Kevin Parsons 2022-01-10 16:27:09 -08:00
parent 1c65b69bd1
commit 4cd8a790e4
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ if not exist ..\bin\tool mkdir ..\bin\tool
if not "x%GOROOT_BOOTSTRAP%"=="x" goto bootstrapset
for /f "tokens=*" %%g in ('where go 2^>nul') do (
if "x%GOROOT_BOOTSTRAP%"=="x" (
for /f "tokens=*" %%i in ('%%g env GOROOT 2^>nul') do (
for /f "tokens=*" %%i in ('"%%g" env GOROOT 2^>nul') do (
if /I not "%%i"=="%GOROOT_TEMP%" (
set GOROOT_BOOTSTRAP=%%i
)