From 7622c96e99921f28c032b742f169d9558df89355 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 22 Aug 2013 21:38:44 +0300 Subject: Bug fix for Mac OS X in passing environment through. --- str_array.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'str_array.c') diff --git a/str_array.c b/str_array.c index e4352a9f..33c9ddcc 100644 --- a/str_array.c +++ b/str_array.c @@ -792,10 +792,15 @@ static NODE ** env_store(NODE *symbol, NODE *subs) { NODE **val = str_exists(symbol, subs); + const char *newval; assert(val != NULL); - (void) setenv(subs->stptr, (*val)->stptr, 1); + newval = (*val)->stptr; + if (newval == NULL) + newval = ""; + + (void) setenv(subs->stptr, newval, 1); return val; } -- cgit v1.2.3