summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-11 17:46:31 +0000
committerChristopher Faylor <me@cgf.cx>2003-09-11 17:46:31 +0000
commitb9041ba3d994383ab377e80e3eb4b7f5ba390bb7 (patch)
tree2962cb354da032215071cf1dd5503693204a782c /winsup/cygwin/path.cc
parent59a7603554ea394683ce65bd044cb901ac4857c7 (diff)
downloadcygnal-b9041ba3d994383ab377e80e3eb4b7f5ba390bb7.tar.gz
cygnal-b9041ba3d994383ab377e80e3eb4b7f5ba390bb7.tar.bz2
cygnal-b9041ba3d994383ab377e80e3eb4b7f5ba390bb7.zip
* path.cc (normalize_posix_path): Put check for '//' prefix back to denote a
UNC path. (slash_unc_prefix_p): Remove vestige of old //c method for accessing drives.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 6412a8a11..b0108777e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -203,10 +203,10 @@ normalize_posix_path (const char *src, char *dst)
syscall_printf ("src %s", src);
- if (isdrive (src))
+ if (isdrive (src) || slash_unc_prefix_p (src))
{
int err = normalize_win32_path (src, dst);
- if (!err && isdrive (dst))
+ if (!err)
for (char *p = dst; (p = strchr (p, '\\')); p++)
*p = '/';
return err;
@@ -1315,9 +1315,7 @@ slash_unc_prefix_p (const char *path)
char *p = NULL;
int ret = (isdirsep (path[0])
&& isdirsep (path[1])
- && isalpha (path[2])
- && path[3] != 0
- && !isdirsep (path[3])
+ && isalnum (path[2])
&& ((p = strpbrk (path + 3, "\\/")) != NULL));
if (!ret || p == NULL)
return ret;