aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.c
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2014-09-18 23:25:11 +0200
committerDavid du Colombier <0intro@gmail.com>2014-09-18 23:25:11 +0200
commit45143aeca47da4595367e9ab0f1d0194f7847a96 (patch)
tree6e44be84e9b0add448f804d5fc26c538dd375ad0 /src/runtime/runtime.c
parentc3b5db895b11ba28bc1546f37178efcb057ab3f0 (diff)
downloadgo-45143aeca47da4595367e9ab0f1d0194f7847a96.tar.xz
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
Diffstat (limited to 'src/runtime/runtime.c')
-rw-r--r--src/runtime/runtime.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index ae754dc5cd..aa8dd8f7a0 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -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");