diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-25 08:08:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-25 08:08:05 (GMT) |
commit | 076eb7c9e473f60d3821b1fcc622f69fbb8eba14 (patch) | |
tree | a937964246806dc7ac13f70b3ee539f6bb5ad598 /generic/tclFileName.c | |
parent | 54bdc7613fcce8f2394851d92ac54f1fd7820db9 (diff) | |
parent | 3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8 (diff) | |
download | tcl-076eb7c9e473f60d3821b1fcc622f69fbb8eba14.zip tcl-076eb7c9e473f60d3821b1fcc622f69fbb8eba14.tar.gz tcl-076eb7c9e473f60d3821b1fcc622f69fbb8eba14.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; } |