summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-05 07:36:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-05 07:36:50 (GMT)
commita019958ca7cc71041afbcc43c6d6a40e88043f9e (patch)
treeacc76654386199ef4076881126d924d5c5e84dc1 /generic/tclFileName.c
parent4b1d6e9ae2d95e94f8d3c2113e43a9dbc45f4597 (diff)
parent3cb6c489a3c0515c7b3aade0aaa139e637400559 (diff)
downloadtcl-a019958ca7cc71041afbcc43c6d6a40e88043f9e.zip
tcl-a019958ca7cc71041afbcc43c6d6a40e88043f9e.tar.gz
tcl-a019958ca7cc71041afbcc43c6d6a40e88043f9e.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 74e4d7f..408d295 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -390,7 +390,6 @@ TclpGetNativePathType(
if (path[0] == '/') {
++path;
-#if defined(__CYGWIN__) || defined(__QNX__)
/*
* Check for "//" network path prefix
*/
@@ -399,22 +398,10 @@ 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);
@@ -632,7 +619,6 @@ SplitUnixPath(
if (*path == '/') {
Tcl_Obj *rootElt;
++path;
-#if defined(__CYGWIN__) || defined(__QNX__)
/*
* Check for "//" network path prefix
*/
@@ -641,19 +627,7 @@ 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);
Tcl_ListObjAppendElement(NULL, result, rootElt);
while (*path == '/') {
@@ -735,10 +709,10 @@ SplitWinPath(
length = p - elementStart;
if (length > 0) {
Tcl_Obj *nextElt;
- if ((elementStart != path) &&
- isalpha(UCHAR(elementStart[0])) &&
- (elementStart[1] == ':')) {
- TclNewLiteralStringObj(nextElt, "./");
+ if ((elementStart != path) &&
+ isalpha(UCHAR(elementStart[0])) &&
+ (elementStart[1] == ':')) {
+ TclNewLiteralStringObj(nextElt, "./");
Tcl_AppendToObj(nextElt, elementStart, length);
} else {
nextElt = Tcl_NewStringObj(elementStart, length);
@@ -840,12 +814,10 @@ TclpNativeJoinPath(
p = joining;
if (length != 0) {
- if ((p[0] == '.') &&
- (p[1] == '/') &&
- (tclPlatform==TCL_PLATFORM_WINDOWS) &&
- isalpha(UCHAR(p[2])) &&
- (p[3] == ':')) {
- p += 2;
+ if ((p[0] == '.') && (p[1] == '/') &&
+ (tclPlatform==TCL_PLATFORM_WINDOWS) && isalpha(UCHAR(p[2]))
+ && (p[3] == ':')) {
+ p += 2;
}
}
if (*p == '\0') {
@@ -2207,7 +2179,7 @@ DoGlob(
for (i=0; result==TCL_OK && i<subdirc; i++) {
Tcl_Obj *copy = NULL;
- result = DoGlob(interp, matchesObj, separators, subdirv[i],
+ result = DoGlob(interp, matchesObj, separators, subdirv[i],
1, p+1, types);
if (copy) {
size_t end;