diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-22 12:07:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-22 12:07:28 (GMT) |
commit | 39b1bc8eefca71fda1f8bebf08eee86cff6f5aec (patch) | |
tree | 205c7cbc0c445f67f3ef81c6269c65f13bc62661 /generic/tclFileName.c | |
parent | 687013812cd6ca56d2bfc1c0b75d98a6f8a2d264 (diff) | |
download | tcl-39b1bc8eefca71fda1f8bebf08eee86cff6f5aec.zip tcl-39b1bc8eefca71fda1f8bebf08eee86cff6f5aec.tar.gz tcl-39b1bc8eefca71fda1f8bebf08eee86cff6f5aec.tar.bz2 |
Cygwin network pathname supportbug_1536227
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 4c57256..de91d81 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); } /* @@ -2196,6 +2213,11 @@ DoGlob( && (strchr(separators, lastChar) == NULL)) || ((length == 0) && (count > 0)))) { Tcl_DStringAppend(&append, "/", 1); +#ifdef __CYGWIN__ + if ((length == 0) && (count > 1)) { + Tcl_DStringAppend(&append, "/", 1); + } +#endif } break; } |