Cygwin: Remove workaround in environ.cc

Commit ebd645e on 2001-10-03 made environ.cc:_addenv() add unneeded
space at the end of the environment block to "work around problems
with some buggy applications."  This clutters the code and is
presumably no longer needed.
This commit is contained in:
Ken Brown 2018-06-06 11:45:57 -04:00 committed by Corinna Vinschen
parent defaa2ca31
commit 3a049236db
1 changed files with 4 additions and 6 deletions

View File

@ -592,13 +592,11 @@ _addenv (const char *name, const char *value, int overwrite)
{ /* Create new slot. */ { /* Create new slot. */
int sz = envsize (cur_environ ()); int sz = envsize (cur_environ ());
/* If sz == 0, we need two new slots, one for the terminating NULL. /* If sz == 0, we need two new slots, one for the terminating NULL. */
But we add two slots in all cases, as has been done since int newsz = sz == 0 ? 2 : sz + 1;
2001-10-03 (commit ebd645e) to "work around problems with int allocsz = newsz * sizeof (char *);
some buggy applications." */
int allocsz = (sz + 2) * sizeof (char *);
offset = sz == 0 ? 0 : sz - 1; offset = newsz - 2;
/* Allocate space for additional element. */ /* Allocate space for additional element. */
if (cur_environ () == lastenviron) if (cur_environ () == lastenviron)