]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] cmd/dist: emit \r in env -w output
authorRuss Cox <rsc@golang.org>
Fri, 21 Sep 2012 19:55:09 +0000 (05:55 +1000)
committerRuss Cox <rsc@golang.org>
Fri, 21 Sep 2012 19:55:09 +0000 (05:55 +1000)
««« backport 108165c03c70
cmd/dist: emit \r in env -w output

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 7f9aa7bcd271c01dd2f22e9c76784de4fd85219c..119c45847182d78fae7778d4cf1d42f291fe59cf 100644 (file)
@@ -1301,7 +1301,7 @@ cmdenv(int argc, char **argv)
                vflag++;
                break;
        case 'w':
-               format = "set %s=%s\n";
+               format = "set %s=%s\r\n";
                break;
        default:
                usage();