From 90253b8276706cb548d712ca8c732e4642ae9b32 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 15 May 2005 12:29:47 +0000 Subject: * cygcheck.cc (load_cygwin): Don't touch $PATH for now. (print_version): Fix copyright. * strace.cc (print_version): Ditto. --- winsup/utils/cygcheck.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'winsup/utils/cygcheck.cc') diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index dd815b9ed..afd43175c 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -1,6 +1,6 @@ /* cygcheck.cc - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. This file is part of Cygwin. @@ -1424,7 +1424,7 @@ print_version () printf ("\ cygcheck version %.*s\n\ System Checker for Cygwin\n\ -Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.\n\ +Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.\n\ Compiled on %s\n\ ", len, v, __DATE__); } @@ -1459,10 +1459,19 @@ load_cygwin (int& argc, char **&argv) char **envp = (char **) cygwin_internal (CW_ENVP); if (envp) { + /* Store path and revert to this value, otherwise path gets overwritten + by the POSIXy Cygwin variation, which breaks cygcheck. + Another approach would be to use the Cygwin PATH and convert it to + Win32 again. */ + char *path = NULL; while (*_environ) - nuke (*_environ); + { + if (!strncmp (*_environ, "PATH=", 5)) + path = strdup (*_environ); + nuke (*_environ); + } for (char **ev = envp; *ev; ev++) - putenv (*ev); + putenv (!strncmp (*ev, "PATH=", 5) ? path : *ev); } } -- cgit v1.2.3