Commit 45143aec authored by David du Colombier's avatar David du Colombier

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
parent c3b5db89
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment