* path.cc (conv_path_list): Copy source paths before modifying them.

This commit is contained in:
Christopher Faylor 2001-11-17 20:19:19 +00:00
parent 33f0f67db7
commit 9c6a5c6ea8
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2001-11-17 Nick Duffek <nick@duffek.com>
* path.cc (conv_path_list): Copy source paths before modifying them.
2001-11-17 Corinna Vinschen <corinna@vinschen.de> 2001-11-17 Corinna Vinschen <corinna@vinschen.de>
* fhandler_raw.cc (fhandler_dev_raw::clear): Don't reset unit. * fhandler_raw.cc (fhandler_dev_raw::clear): Don't reset unit.

View File

@ -1234,17 +1234,22 @@ conv_path_list (const char *src, char *dst, int to_posix_p)
int (*conv_fn) (const char *, char *) = (to_posix_p int (*conv_fn) (const char *, char *) = (to_posix_p
? cygwin_conv_to_posix_path ? cygwin_conv_to_posix_path
: cygwin_conv_to_win32_path); : cygwin_conv_to_win32_path);
char srcbuf[MAX_PATH];
int len;
do do
{ {
s = strchr (src, src_delim); s = strchr (src, src_delim);
if (s) if (s)
{ {
*s = 0; len = s - src;
(*conv_fn) (src[0] != 0 ? src : ".", d); if (len >= MAX_PATH)
len = MAX_PATH - 1;
memcpy (srcbuf, src, len);
srcbuf[len] = 0;
(*conv_fn) (len ? srcbuf : ".", d);
d += strlen (d); d += strlen (d);
*d++ = dst_delim; *d++ = dst_delim;
*s = src_delim;
src = s + 1; src = s + 1;
} }
else else