From dfc548dddafbf4e58a568329ebbe29f1eb36a0e8 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 13 Apr 2012 09:19:07 -0700 Subject: add option exec-env to set env variables during test execution --- src/libcore/run.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 0b82d79b331..34ba16844d8 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -98,7 +98,7 @@ fn with_envp(env: option<[(str,str)]>, // On posixy systems we can pass a char** for envp, which is // a null-terminated array of "k=v\n" strings. alt env { - some (es) { + some(es) if !vec::is_empty(es) { let mut tmps = []; let mut ptrs = []; @@ -111,7 +111,7 @@ fn with_envp(env: option<[(str,str)]>, ptrs += [ptr::null()]; vec::as_buf(ptrs) { |p| cb(::unsafe::reinterpret_cast(p)) } } - none { + _ { cb(ptr::null()) } } @@ -124,7 +124,7 @@ fn with_envp(env: option<[(str,str)]>, // rather a concatenation of null-terminated k=v\0 sequences, with a final // \0 to terminate. alt env { - some (es) { + some(es) if !vec::is_empty(es) { let mut blk : [u8] = []; for vec::each(es) {|e| let (k,v) = e; @@ -136,7 +136,7 @@ fn with_envp(env: option<[(str,str)]>, blk += [0_u8]; vec::as_buf(blk) {|p| cb(::unsafe::reinterpret_cast(p)) } } - none { + _ { cb(ptr::null()) } } -- cgit 1.4.1-3-g733a5