From 4cd8a790e41353bb6bb2bfc36db1013ab0dcae6d Mon Sep 17 00:00:00 2001 From: Kevin Parsons Date: Mon, 10 Jan 2022 16:27:09 -0800 Subject: [PATCH] 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 --- src/make.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/make.bat b/src/make.bat index 104fb485b4..814d12c300 100644 --- a/src/make.bat +++ b/src/make.bat @@ -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 )