mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
* path.cc (normalize_win32_path): Honor network paths. Fold more
than two leading dir separators into one. Check for dir separator instead of just slashes to handle incoming Win32 paths correctly.
This commit is contained in:
parent
4a8b3ef692
commit
9d13e04523
@ -1,3 +1,9 @@
|
||||
2005-08-25 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* path.cc (normalize_win32_path): Honor network paths. Fold more
|
||||
than two leading dir separators into one. Check for dir separator
|
||||
instead of just slashes to handle incoming Win32 paths correctly.
|
||||
|
||||
2005-08-25 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* errno.cc (errmap): Translate ERROR_NO_MORE_ITEMS to ENMFILE.
|
||||
|
@ -1089,18 +1089,29 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
|
||||
bool beg_src_slash = isdirsep (src[0]);
|
||||
|
||||
tail = dst;
|
||||
if (beg_src_slash && isdirsep (src[1]) && src[2])
|
||||
if (beg_src_slash && isdirsep (src[1]))
|
||||
{
|
||||
*tail++ = '\\';
|
||||
src++;
|
||||
if (src[1] == '.' && isdirsep (src[2]))
|
||||
{
|
||||
*tail++ = '\\';
|
||||
*tail++ = '.';
|
||||
if (isdirsep (src[2]))
|
||||
{
|
||||
/* More than two slashes are just folded into one. */
|
||||
src += 2;
|
||||
while (isdirsep (src[1]))
|
||||
++src;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Two slashes start a network or device path. */
|
||||
*tail++ = '\\';
|
||||
src++;
|
||||
if (src[1] == '.' && isdirsep (src[2]))
|
||||
{
|
||||
*tail++ = '\\';
|
||||
*tail++ = '.';
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!isdrive(src) && *src != '/')
|
||||
if (tail == dst && !isdrive(src) && isdirsep (*src))
|
||||
{
|
||||
if (beg_src_slash)
|
||||
tail += cygheap->cwd.get_drive (dst);
|
||||
|
Loading…
x
Reference in New Issue
Block a user