* environ.cc (parse_options): Use tmp_pathbuf to allocate buffer.

(regopt): Take tmp buffer as additional argument.
	(environ_init): Alllcate tmpbuf earlier.  Use as temporary buffer in
	call to regopt.
	* tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char.
	(tmp_pathbuf::w_get): Allocate one additional WCHAR.
	* winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer.
This commit is contained in:
Corinna Vinschen
2008-03-11 11:42:00 +00:00
parent ff488124ff
commit becf251f67
4 changed files with 23 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ details. */
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
#include "tls_pbuf.h"
#include "winf.h"
#include "sys/cygwin.h"
@@ -136,7 +137,8 @@ av::unshift (const char *what, int conv)
argv = av;
memmove (argv + 1, argv, (argc + 1) * sizeof (char *));
char buf[CYG_MAX_PATH];
tmp_pathbuf tp;
char *buf = tp.c_get ();
if (conv)
{
cygwin_conv_to_posix_path (what, buf);