]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: emit \r in env -w output
authorRuss Cox <rsc@golang.org>
Wed, 12 Sep 2012 16:05:34 +0000 (12:05 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 12 Sep 2012 16:05:34 +0000 (12:05 -0400)
go tool dist env -w is supposed to print a Windows batch file.
Normally Windows will execute batch files without \r before \n,
but issue 3060 reports that if the file ends up containing paths
written in Chinese, Windows 7 cannot execute it without the \r.
So add the \r.

Fixes #3060.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6498120

src/cmd/dist/build.c

index f21b5afda310d2476acf7638e3944c6ab7320eba..9522dffb2b008f8c1878b2cf42ba24a9484a5dea 100644 (file)
@@ -1352,7 +1352,7 @@ cmdenv(int argc, char **argv)
                vflag++;
                break;
        case 'w':
-               format = "set %s=%s\n";
+               format = "set %s=%s\r\n";
                break;
        default:
                usage();