summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-01 17:27:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-01 17:27:03 (GMT)
commitb3838ea4450c4d290daa647c9a7f62d4e55ee7c0 (patch)
treeab8048833cbc1d40199a4e58b2f20fa8c271484e /generic/tclFileName.c
parent99e3536c5deb6093092d55b86128553876ecc7d6 (diff)
downloadtcl-b3838ea4450c4d290daa647c9a7f62d4e55ee7c0.zip
tcl-b3838ea4450c4d290daa647c9a7f62d4e55ee7c0.tar.gz
tcl-b3838ea4450c4d290daa647c9a7f62d4e55ee7c0.tar.bz2
Backport TIP #402: General Platform UNC Support from 8.7, but only for Cygwin and QNX. This was already partially present, but was never completed.
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index b6a6439..dcd3d0e 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -5,7 +5,7 @@
* and network form.
*
* Copyright (c) 1995-1998 Sun Microsystems, Inc.
- * Copyright (c) 1998-1999 by Scriptics Corporation.
+ * Copyright (c) 1998-1999 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -422,22 +422,11 @@ TclpGetNativePathType(
while (*path && *path != '/') {
++path;
}
-#if defined(__CYGWIN__)
- /* UNC paths need to be followed by a share name */
- if (*path++ && (*path && *path != '/')) {
- ++path;
- while (*path && *path != '/') {
- ++path;
- }
- } else {
- path = origPath + 1;
- }
-#endif
}
#endif
if (driveNameLengthPtr != NULL) {
/*
- * We need this addition in case the QNX or Cygwin code was used.
+ * We need this addition in case the "//" code was used.
*/
*driveNameLengthPtr = (path - origPath);
@@ -664,17 +653,6 @@ SplitUnixPath(
while (*path && *path != '/') {
++path;
}
-#if defined(__CYGWIN__)
- /* UNC paths need to be followed by a share name */
- if (*path++ && (*path && *path != '/')) {
- ++path;
- while (*path && *path != '/') {
- ++path;
- }
- } else {
- path = origPath + 1;
- }
-#endif
}
#endif
rootElt = Tcl_NewStringObj(origPath, path - origPath);
@@ -1889,7 +1867,11 @@ TclGlob(
separators = "/\\";
} else if (tclPlatform == TCL_PLATFORM_UNIX) {
- if (pathPrefix == NULL && tail[0] == '/') {
+ if (pathPrefix == NULL && tail[0] == '/'
+#if defined(__CYGWIN__) || defined(__QNX__)
+ && tail[1] != '/'
+#endif
+ ) {
pathPrefix = Tcl_NewStringObj(tail, 1);
tail++;
Tcl_IncrRefCount(pathPrefix);