Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-04-30 12:49:23 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-04-30 12:49:23 +0400
commit7e2b8e7d2a285b621130654523ed274eb0db277b (patch)
tree2d4ba8d7f78ef93649fff4bb1958e7fd1f9d5377 /winsup/cygwin/mount.cc
parentf77a1a884885a10a5210a42ad9bff6514eb0c374 (diff)
* mount.cc (is_unc_share): Allow \\?\ prefix as well. Enhance comment.
(mount_info::from_fstab): Remove patch from 2008-04-29. * mount.cc (mount_info::conv_to_posix_path): Simplify test for native UNC path. * path.cc (normalize_win32_path): Ditto. (symlink_worker): Ditto. (symlink_info::posixify): Ditto. (cygwin_conv_path): Ditto.
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 5fdef2d09..0f13697b3 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -42,7 +42,10 @@ details. */
#define isproc(path) \
(path_prefix_p (proc, (path), proc_len))
-/* is_unc_share: Return non-zero if PATH begins with //UNC/SHARE */
+/* is_unc_share: Return non-zero if PATH begins with //server/share
+ or with one of the native prefixes //./ or //?/
+ This function is only used to test for valid input strings.
+ The later normalization drops the native prefixes. */
static inline bool __stdcall
is_unc_share (const char *path)
@@ -50,7 +53,7 @@ is_unc_share (const char *path)
const char *p;
return (isdirsep (path[0])
&& isdirsep (path[1])
- && (isalnum (path[2]) || path[2] == '.')
+ && (isalnum (path[2]) || path[2] == '.' || path[2] == '?')
&& ((p = strpbrk (path + 3, "\\/")) != NULL)
&& isalnum (p[1]));
}
@@ -576,10 +579,9 @@ mount_info::conv_to_posix_path (PWCHAR src_path, char *posix_path,
if (!wcsncmp (src_path, L"\\\\?\\", 4))
{
src_path += 4;
- if (!wcsncmp (src_path, L"UNC\\", 4))
+ if (src_path[1] != L':') /* native UNC path */
{
- src_path += 2;
- src_path[0] = L'\\';
+ *(src_path += 2) = L'\\';
changed = true;
}
}
@@ -881,12 +883,6 @@ mount_info::from_fstab (bool user)
debug_printf ("GetModuleFileNameW, %E");
return false;
}
- if (!wcsncmp (path, L"\\\\?\\", 4))
- {
- path += 4;
- if (path[1] != L':')
- *(path += 2) = L'\\';
- }
w = wcsrchr (path, L'\\');
if (w)
{