1
0
mirror of https://github.com/golang/go synced 2024-10-04 08:31:22 -06:00
go/src/pkg/runtime/mkversion.c
Peter Mundy aee6b1160e runtime: fix mkversion to output valid path separators
In a GOROOT path a backslash is a path separator
not an escape character. For example, `C:\go`.
Fixes gotest error:
version.go:3: unknown escape sequence: g

R=rsc
CC=golang-dev
https://golang.org/cl/4437076
2011-04-27 15:47:12 -04:00

16 lines
262 B
C

#include <u.h>
#include <libc.h>
char *template =
"// generated by mkversion.c; do not edit.\n"
"package runtime\n"
"const defaultGoroot = `%s`\n"
"const theVersion = \"%s\"\n";
void
main(void)
{
print(template, getgoroot(), getgoversion());
exits(0);
}