From 8c3a79bb97bec5b218c8d6d5627698091c408fef Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 15 Apr 2009 10:00:40 +0000 Subject: [PATCH] * cygpath.cc (do_pathconv): Only skip \\?\ prefix if it's really given. Do backslash to slash conversion for mixed paths after handling \\?\ prefix. --- winsup/utils/ChangeLog | 6 ++++++ winsup/utils/cygpath.cc | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 0cb88fb23..635cbdbb7 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,9 @@ +2009-04-15 Corinna Vinschen + + * cygpath.cc (do_pathconv): Only skip \\?\ prefix if it's really + given. Do backslash to slash conversion for mixed paths after + handling \\?\ prefix. + 2009-04-13 Dave Korn * Makefile.in (dumper.exe): Add -lz to ALL_LDFLAGS. diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 0e60e269e..ade86f7f2 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -744,17 +744,20 @@ do_pathconv (char *filename) buf = get_short_name (buf); if (longname_flag) buf = get_long_name (buf, len); + if (strncmp (buf, "\\\\?\\", 4) == 0) + { + len = 4; + if (strncmp (buf + 4, "UNC\\", 4) == 0) + len = 6; + if (strlen (buf) < MAX_PATH + len) + { + buf += len; + if (len == 6) + *buf = '\\'; + } + } if (mixed_flag) buf = get_mixed_name (buf); - len = 4; - if (strncmp (buf, "\\\\?\\UNC\\", 8) == 0) - len = 6; - if (strlen (buf) < MAX_PATH + len) - { - buf += len; - if (len == 6) - *buf = '\\'; - } } }