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:
parent
c3b5db895b
commit
45143aeca4
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user