[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk: testext.awk:14: fatal error: internal error
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] gawk: testext.awk:14: fatal error: internal error |
Date: |
Thu, 22 Aug 2013 21:37:29 +0300 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Thanks for the trace.
Fortunately, my old PPC mac also showed the issue. Below is a patch that
I will push shortly.
Arnold
----------------------
diff --git a/str_array.c b/str_array.c
index e4352a9..33c9ddc 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;
}