* exceptions.cc (try_to_debug): Fix off-by-one problem when resetting

environment variable after error_start detected.
* fhandler_tty_slave.cc (fhandler_tty_slave::close): Clarify debug message.
* syscalls.cc (setsid): Don't increment usecount here, since it will be
automatically decremented on close.
This commit is contained in:
Christopher Faylor
2003-12-27 00:25:02 +00:00
parent 6dc18ca4d3
commit 56b5feb639
4 changed files with 18 additions and 5 deletions

View File

@ -350,12 +350,15 @@ try_to_debug (bool waitloop)
char* rawenv = GetEnvironmentStrings () ;
for (char* p = rawenv; *p != '\0'; p = strchr (p, '\0') + 1)
{
if (strncmp (p, "CYGWIN=", sizeof ("CYGWIN=") - 1) == 0)
if (strncmp (p, "CYGWIN=", strlen ("CYGWIN=")) == 0)
{
char* q = strstr (p, "error_start") ;
/* replace 'error_start=...' with '_rror_start=...' */
if (q) *q = '_' ;
SetEnvironmentVariable ("CYGWIN", p + sizeof ("CYGWIN=")) ;
if (q)
{
*q = '_' ;
SetEnvironmentVariable ("CYGWIN", p + strlen ("CYGWIN=")) ;
}
break ;
}
}