~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to str_array.c

  • Committer: Arnold D. Robbins
  • Date: 2013-08-22 18:38:44 UTC
  • mto: (408.9.4)
  • mto: This revision was merged to the branch mainline in revision 501.
  • Revision ID: git-v1:7622c96e99921f28c032b742f169d9558df89355
Bug fix for Mac OS X in passing environment through.

Show diffs side-by-side

added added

removed removed

Lines of Context:
792
792
env_store(NODE *symbol, NODE *subs)
793
793
{
794
794
        NODE **val = str_exists(symbol, subs);
 
795
        const char *newval;
795
796
 
796
797
        assert(val != NULL);
797
798
 
798
 
        (void) setenv(subs->stptr, (*val)->stptr, 1);
 
799
        newval = (*val)->stptr;
 
800
        if (newval == NULL)
 
801
                newval = "";
 
802
 
 
803
        (void) setenv(subs->stptr, newval, 1);
799
804
 
800
805
        return val;
801
806
}