diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-25 07:54:37 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-25 07:54:37 (GMT) |
commit | 3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8 (patch) | |
tree | 2f6e0a397ce9c0cada48f0a8e54a50dd1f1e3f64 | |
parent | c6060d6e629b818850b39214f796339032378217 (diff) | |
parent | 39b1bc8eefca71fda1f8bebf08eee86cff6f5aec (diff) | |
download | tcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.zip tcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.tar.gz tcl-3b5f5de0a5c31cd0891ca0398b8573ce3e7111b8.tar.bz2 |
[Patch #1536227]: Cygwin network pathname support
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclFileName.c | 29 | ||||
-rw-r--r-- | tests/fileName.test | 6 |
3 files changed, 31 insertions, 9 deletions
@@ -1,3 +1,8 @@ +2012-06-25 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclfileName.c: [Patch #1536227]: Cygwin network pathname + * tests/fileName.test: support + 2012-06-23 Jan Nijtmans <nijtmans@users.sf.net> * unix/tclUnixNotfy.c: [Bug 3508771]: Cygwin notifier for handling 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); } /* diff --git a/tests/fileName.test b/tests/fileName.test index c613068..a91f4b3 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -189,7 +189,7 @@ test filename-4.12 {Tcl_SplitPath: unix} {testsetplatform} { test filename-4.13 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split //foo -} {/ foo} +} "[file split //] foo" test filename-4.14 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo//bar @@ -429,11 +429,11 @@ test filename-7.16 {Tcl_JoinPath: unix} {testsetplatform} { test filename-7.17 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join //a b -} {/a/b} +} "[file split //]a/b" test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /// a b -} {/a/b} +} "[file split //]a/b" test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { |