- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory

allocation when retrieving core Windows environment.  Add CYGWIN variable
   to propagated variables.  Patch from vinschen at redhat.com, ok djm@
This commit is contained in:
Darren Tucker 2005-05-25 19:42:10 +10:00
parent 328118aa79
commit ae8c91ec07
2 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,9 @@
idea, it is now known as UNSUPPORTED_POSIX_THREADS_HACK. Attempting to use
USE_POSIX_THREADS will now generate an error so we don't silently change
behaviour. ok djm@
- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory
allocation when retrieving core Windows environment. Add CYGWIN variable
to propagated variables. Patch from vinschen at redhat.com, ok djm@
20050524
- (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure
@ -2492,4 +2495,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.3758 2005/05/25 06:18:09 dtucker Exp $
$Id: ChangeLog,v 1.3759 2005/05/25 09:42:10 dtucker Exp $

View File

@ -29,7 +29,7 @@
#include "includes.h"
RCSID("$Id: bsd-cygwin_util.c,v 1.13 2004/08/30 10:42:08 dtucker Exp $");
RCSID("$Id: bsd-cygwin_util.c,v 1.14 2005/05/25 09:42:11 dtucker Exp $");
#ifdef HAVE_CYGWIN
@ -247,6 +247,7 @@ static struct wenv {
{ NL("COMMONPROGRAMFILES=") },
{ NL("COMPUTERNAME=") },
{ NL("COMSPEC=") },
{ NL("CYGWIN=") },
{ NL("NUMBER_OF_PROCESSORS=") },
{ NL("OS=") },
{ NL("PATH=") },
@ -260,7 +261,7 @@ static struct wenv {
{ NL("SYSTEMROOT=") },
{ NL("TMP=") },
{ NL("TEMP=") },
{ NL("WINDIR=") },
{ NL("WINDIR=") }
};
char **
@ -269,7 +270,7 @@ fetch_windows_environment(void)
char **e, **p;
int i, idx = 0;
p = xmalloc(WENV_SIZ * sizeof(char *));
p = xmalloc((WENV_SIZ + 1) * sizeof(char *));
for (e = environ; *e != NULL; ++e) {
for (i = 0; i < WENV_SIZ; ++i) {
if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen))