* cygcheck.cc (pretty_id): Drop arguments. Don't change CYGWIN

environment variable.
	(dump_sysinfo): Don't tweak CYGWIN environment variable, just call
	pretty_id once.
This commit is contained in:
Corinna Vinschen 2009-10-28 11:41:27 +00:00
parent 757ee9af8b
commit d952e44c44
2 changed files with 10 additions and 17 deletions

View File

@ -1,3 +1,10 @@
2009-10-28 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (pretty_id): Drop arguments. Don't change CYGWIN
environment variable.
(dump_sysinfo): Don't tweak CYGWIN environment variable, just call
pretty_id once.
2009-10-20 Corinna Vinschen <corinna@vinschen.de> 2009-10-20 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (dump_sysinfo): Update with latest NT 6.1 versions. * cygcheck.cc (dump_sysinfo): Update with latest NT 6.1 versions.

View File

@ -1031,14 +1031,10 @@ scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygwin, bool wow64)
} }
void void
pretty_id (const char *s, char *cygwin, size_t cyglen) pretty_id ()
{ {
char *groups[16384]; char *groups[16384];
strcpy (cygwin + cyglen++, " ");
strcpy (cygwin + cyglen, s);
putenv (cygwin);
char *id = cygpath ("/bin/id.exe", NULL); char *id = cygpath ("/bin/id.exe", NULL);
for (char *p = id; (p = strchr (p, '/')); p++) for (char *p = id; (p = strchr (p, '/')); p++)
*p = '\\'; *p = '\\';
@ -1094,7 +1090,7 @@ pretty_id (const char *s, char *cygwin, size_t cyglen)
} }
ng--; ng--;
printf ("\nOutput from %s (%s)\n", id, s); printf ("\nOutput from %s\n", id);
int n = 80 / (int) ++sz; int n = 80 / (int) ++sz;
int i = n > 2 ? n - 2 : 0; int i = n > 2 ? n - 2 : 0;
sz = -sz; sz = -sz;
@ -1479,17 +1475,7 @@ dump_sysinfo ()
fflush (stdout); fflush (stdout);
char *cygwin = getenv ("CYGWIN"); pretty_id ();
if (cygwin)
cygwin -= strlen ("CYGWIN=");
else
cygwin = const_cast <char *> ("CYGWIN=");
size_t cyglen = strlen (cygwin);
cygwin = strcpy ((char *) malloc (cyglen + sizeof (" nontsec")), cygwin);
pretty_id ("nontsec", cygwin, cyglen);
pretty_id ("ntsec", cygwin, cyglen);
cygwin[cyglen] = 0;
putenv (cygwin);
if (!GetSystemDirectory (tmp, 4000)) if (!GetSystemDirectory (tmp, 4000))
display_error ("dump_sysinfo: GetSystemDirectory()"); display_error ("dump_sysinfo: GetSystemDirectory()");