summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-25 07:54:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-25 07:54:37 (GMT)
commit3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8 (patch)
tree2f6e0a397ce9c0cada48f0a8e54a50dd1f1e3f64 /generic/tclFileName.c
parentc6060d6e629b818850b39214f796339032378217 (diff)
parent39b1bc8eefca71fda1f8bebf08eee86cff6f5aec (diff)
downloadtcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.zip
tcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.tar.gz
tcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.tar.bz2
[Patch #1536227]: Cygwin network pathname support
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 4c57256..a6bb932 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -414,9 +414,17 @@ TclpGetNativePathType(
}
#endif
if (path[0] == '/') {
+#ifdef __CYGWIN__
+ /*
+ * Check for Cygwin // network path prefix
+ */
+ if (path[1] == '/') {
+ path++;
+ }
+#endif
if (driveNameLengthPtr != NULL) {
/*
- * We need this addition in case the QNX code was used.
+ * We need this addition in case the QNX or Cygwin code was used.
*/
*driveNameLengthPtr = (1 + path - origPath);
@@ -643,11 +651,20 @@ SplitUnixPath(
}
#endif
- if (path[0] == '/') {
- Tcl_ListObjAppendElement(NULL, result, Tcl_NewStringObj("/",1));
- p = path+1;
- } else {
- p = path;
+ p = path;
+ if (*p == '/') {
+ Tcl_Obj *rootElt = Tcl_NewStringObj("/", 1);
+ p++;
+#ifdef __CYGWIN__
+ /*
+ * Check for Cygwin // network path prefix
+ */
+ if (*p == '/') {
+ Tcl_AppendToObj(rootElt, "/", 1);
+ p++;
+ }
+#endif
+ Tcl_ListObjAppendElement(NULL, result, rootElt);
}
/*