* path.cc (mount_info::conv_to_win32_path): Fix debugging output to avoid a

SIGSEGV.  Avoid double backslashes in middle of filename.
This commit is contained in:
Christopher Faylor 2001-05-01 04:45:19 +00:00
parent d3c7e9de28
commit beab320f33
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Tue May 1 00:34:46 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (mount_info::conv_to_win32_path): Fix debugging output to
avoid a SIGSEGV. Avoid double backslashes in middle of filename.
Mon Apr 30 21:51:14 2001 Christopher Faylor <cgf@cygnus.com> Mon Apr 30 21:51:14 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (mkrelpath): New function. * path.cc (mkrelpath): New function.

View File

@ -1242,7 +1242,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
int n = mi->native_pathlen; int n = mi->native_pathlen;
memcpy (dst, mi->native_path, n + 1); memcpy (dst, mi->native_path, n + 1);
char *p = pathbuf + mi->posix_pathlen; char *p = pathbuf + mi->posix_pathlen;
if ((isdrive (dst) && !dst[2]) || (p && dst[n - 1] != '\\')) if ((isdrive (dst) && !dst[2]) || (*p && dst[n - 1] != '\\'))
dst[n++] = '\\'; dst[n++] = '\\';
strcpy (dst + n, p); strcpy (dst + n, p);
backslashify (dst, dst, 0); backslashify (dst, dst, 0);
@ -1251,7 +1251,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
out: out:
MALLOC_CHECK; MALLOC_CHECK;
debug_printf ("src_path %s, win32 %s, flags %p", dst, *flags, src_path); debug_printf ("src_path %s, dst %s, flags %p", src_path, dst, *flags);
return 0; return 0;
} }