]> Cypherpunks repositories - gostls13.git/commitdiff
make.bat: support existing toolchain paths with spaces
authorKevin Parsons <kevpar@microsoft.com>
Thu, 19 Jan 2023 07:40:12 +0000 (07:40 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 19 Jan 2023 20:43:23 +0000 (20:43 +0000)
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

Change-Id: Icacf8dd5178b608225f02e4a11a8753d78bed262
GitHub-Last-Rev: 4cd8a790e41353bb6bb2bfc36db1013ab0dcae6d
GitHub-Pull-Request: golang/go#57836
Reviewed-on: https://go-review.googlesource.com/c/go/+/462275
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/make.bat

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