1
0
mirror of https://github.com/golang/go synced 2024-09-25 15:20:13 -06:00

runtime: fix handling of GOTRACEBACK

Since CL 130990043, the GOTRACEBACK variable is
only used when the GODEBUG variable is set.
This change restores the original behavior.

LGTM=rsc
R=golang-codereviews, aram, gobot, r, rsc
CC=golang-codereviews
https://golang.org/cl/132520043
This commit is contained in:
David du Colombier 2014-09-18 23:25:11 +02:00
parent c3b5db895b
commit 45143aeca4

View File

@ -287,18 +287,18 @@ runtime·parsedebugvars(void)
intgo i, n;
p = runtime·getenv("GODEBUG");
if(p == nil)
return;
for(;;) {
for(i=0; i<nelem(dbgvar); i++) {
n = runtime·findnull((byte*)dbgvar[i].name);
if(runtime·mcmp(p, (byte*)dbgvar[i].name, n) == 0 && p[n] == '=')
*dbgvar[i].value = runtime·atoi(p+n+1);
if(p != nil){
for(;;) {
for(i=0; i<nelem(dbgvar); i++) {
n = runtime·findnull((byte*)dbgvar[i].name);
if(runtime·mcmp(p, (byte*)dbgvar[i].name, n) == 0 && p[n] == '=')
*dbgvar[i].value = runtime·atoi(p+n+1);
}
p = runtime·strstr(p, (byte*)",");
if(p == nil)
break;
p++;
}
p = runtime·strstr(p, (byte*)",");
if(p == nil)
break;
p++;
}
p = runtime·getenv("GOTRACEBACK");