From b0d5cd02dc25d24e7f45d393929ae79cc9808862 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 17 Jul 2000 15:59:27 +0000 Subject: [PATCH] * environ.cc (setenv): Use __cygwin_environ instead of environ after reallocating environment space. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/environ.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 976a685e5..56c48a884 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 17 17:56:00 2000 Corinna Vinschen + + * environ.cc (setenv): Use __cygwin_environ instead of + environ after reallocating environment space. + Sun Jul 16 20:23:21 2000 Christopher Faylor * _cygwin_crt0_common.cc: Undef 'environ' or suffer compiler error. diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 4aa5ad75b..b53600724 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -228,9 +228,9 @@ setenv (const char *name, const char *value, int rewrite) ; __cygwin_environ = (char **) realloc ((char *) environ, (size_t) (sizeof (char *) * (cnt + 2))); - if (!environ) + if (!__cygwin_environ) return -1; - environ[cnt + 1] = NULL; + __cygwin_environ[cnt + 1] = NULL; update_envptrs (); offset = cnt; }