diff options
| -rw-r--r-- | doc/filename.n | 7 | ||||
| -rw-r--r-- | generic/tclFileName.c | 8 | ||||
| -rw-r--r-- | tests/cmdAH.test | 8 | ||||
| -rw-r--r-- | tests/fileName.test | 6 |
4 files changed, 12 insertions, 17 deletions
diff --git a/doc/filename.n b/doc/filename.n index d481fc9..f1cd703 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -47,7 +47,8 @@ absolute, and file names may contain any character other than slash. The file names \fB\&.\fR and \fB\&..\fR are special and refer to the current directory and the parent of the current directory respectively. Multiple adjacent slash characters are interpreted as a single -separator. Any number of trailing slash characters at the end of a +separator, except for the first double slash \fB//\fR in absolute paths. +Any number of trailing slash characters at the end of a path are simply ignored, so the paths \fBfoo\fR, \fBfoo/\fR and \fBfoo//\fR are all identical, and in particular \fBfoo/\fR does not necessarily mean a directory is being referred. @@ -150,9 +151,7 @@ The safest approach is to use names consisting of alphanumeric characters only. Care should be taken with filenames which contain spaces (common on Windows systems) and filenames where the backslash is the directory separator (Windows -native path names). Also Windows 3.1 only supports file -names with a root of no more than 8 characters and an extension of no -more than 3 characters. +native path names). .PP On Windows platforms there are file and path length restrictions. Complete paths or filenames longer than about 260 characters will lead diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 48c5454..3e78a05 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -424,14 +424,12 @@ TclpGetNativePathType( } #endif if (path[0] == '/') { -#ifdef __CYGWIN__ /* - * Check for Cygwin // network path prefix + * Check for "//" prefix */ if (path[1] == '/') { path++; } -#endif if (driveNameLengthPtr != NULL) { /* * We need this addition in case the QNX or Cygwin code was used. @@ -665,15 +663,13 @@ SplitUnixPath( if (*p == '/') { Tcl_Obj *rootElt = Tcl_NewStringObj("/", 1); p++; -#ifdef __CYGWIN__ /* - * Check for Cygwin // network path prefix + * Check for "//" prefix */ if (*p == '/') { Tcl_AppendToObj(rootElt, "/", 1); p++; } -#endif Tcl_ListObjAppendElement(NULL, result, rootElt); } diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 291df8d..fbe51d2 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -303,19 +303,19 @@ test cmdAH-8.13 {Tcl_FileObjCmd: dirname} testsetplatform { test cmdAH-8.14 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname //foo -} / +} // test cmdAH-8.15 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname //foo/bar -} /foo +} //foo test cmdAH-8.16 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname {//foo\/bar/baz} -} {/foo\/bar} +} {//foo\/bar} test cmdAH-8.17 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname {//foo\/bar/baz/blat} -} {/foo\/bar/baz} +} {//foo\/bar/baz} test cmdAH-8.18 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname /foo// diff --git a/tests/fileName.test b/tests/fileName.test index 251f12c..aab8d33 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -196,7 +196,7 @@ test filename-4.12 {Tcl_SplitPath: unix} {testsetplatform} { test filename-4.13 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split //foo -} "[file split //] foo" +} "// foo" test filename-4.14 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo//bar @@ -433,11 +433,11 @@ test filename-7.16 {Tcl_JoinPath: unix} {testsetplatform} { test filename-7.17 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join //a b -} "[file split //]a/b" +} "//a/b" test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /// a b -} "[file split //]a/b" +} "//a/b" test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win |
