diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-25 08:08:05 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-25 08:08:05 (GMT) |
| commit | f9e05c20db92776c8622fa91b1d4563829b7b5e6 (patch) | |
| tree | a937964246806dc7ac13f70b3ee539f6bb5ad598 /generic/tclFileName.c | |
| parent | 0cf4cab593e13b820551df31cd04aa8228567abf (diff) | |
| parent | f8f609e850ed5b8d85ebf4b8c5485a64ba2215e0 (diff) | |
| download | tcl-f9e05c20db92776c8622fa91b1d4563829b7b5e6.zip tcl-f9e05c20db92776c8622fa91b1d4563829b7b5e6.tar.gz tcl-f9e05c20db92776c8622fa91b1d4563829b7b5e6.tar.bz2 | |
[Patch #1536227]: Cygwin network pathname support
Diffstat (limited to 'generic/tclFileName.c')
| -rw-r--r-- | generic/tclFileName.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index b130169..48c5454 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -424,9 +424,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); @@ -653,11 +661,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); } /* @@ -2400,17 +2417,6 @@ DoGlob( Tcl_DStringAppend(&append, ".", 1); } } -#if defined(__CYGWIN__) && !defined(__WIN32__) - { - DLLIMPORT extern int cygwin_conv_to_posix_path(const char *, - char *); - char winbuf[MAXPATHLEN+1]; - - cygwin_conv_to_posix_path(Tcl_DStringValue(&append), winbuf); - Tcl_DStringFree(&append); - Tcl_DStringAppend(&append, winbuf, -1); - } -#endif /* __CYGWIN__ && __WIN32__ */ break; } |
